﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;

using H2.NET.Business;

namespace H2.NET.Web.Pages
{
    public partial class Logistics : TaskControl
    {
        #region 属性 Public
        public string FORM
        {
            get
            {
                return (Parent as TabMaterial).Status.FORM;
            }
        }

        public string Category
        {
            get
            {
                return (Parent as TabMaterial).Status.Category;
            }
        }

        public string Action
        {
            get
            {
                return (Parent as TabMaterial).Status.Logistics;
            }
        }

        private bool IsLoaded
        {
            get
            {
                return ViewState["IsLoaded"] == null ? false : (bool)ViewState["IsLoaded"];
            }
            set { ViewState["IsLoaded"] = value; }
        }

        private bool IsUsed
        {
            get
            {
                //return !(string.IsNullOrEmpty(FORM) || string.IsNullOrEmpty(Action)
                //    || (FORM != "FORM-001" && FORM != "FORM-005" && FORM != "FORM-012" && FORM != "FORM-064" && FORM != "FORM-074"));
                return !string.IsNullOrEmpty(Action);
            }
        }
        #endregion

        #region 事件 页面加载
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Visible = IsUsed;
        }
        #endregion

        #region 方法 InitControls(初始化)
        public void InitControls(mdc_Material mt)
        {
            //如果当前 Tabs 是隐藏的情况，退出
            Visible = IsUsed;
            if (!IsUsed)
            {
                return;
            }

            InitShowHide();

            if (!IsLoaded)
            {
                InitDropDownList();
            }

            Distribute(mt);

            SetForeColor(Color.Black, LOG_Gross_Weight_L, LOG_Net_Weight_L, LOG_Cc_Phys_L, LOG_Volume_L, LOG_Coefficient_Of_Logistic_L, LOG_LoadingGrp_L, LOG_Storage_Location_L, LOG_Weight_Unit_L
                                      , LOG_Net_Weight_L, LOG_Gross_Weight_L, LOG_Volume_Unit_L, LOG_Volume_L, LOG_Trans_Grp_L, LOG_Cc_Fixed_L
                                      , LOG_Unit_Of_Measure_L, LOG_Unit_Of_Measure_X_L, LOG_Unit_Of_Measure_AUN_L, LOG_Unit_Of_Measure_Y_L
                                      , LOG_Unit_Of_Measure_Bun_L, LOG_Quantity_per_box_L, LOG_Transportation_group_L, LOG_Warehouse_No_L, LOG_Storage_Type_L, LOG_Stock_placement_L
                                      , LOG_Bulk_storage_L, LOG_Storage_Bin_L, LOG_Storage_Section_Ind_L, LOG_LE_quantity1_L, LOG_LE_quantity2_L, LOG_LE_quantity3_L
                                      , LOG_SUT1_L, LOG_SUT2_L, LOG_SUT3_L, LOG_Maximum_bin_quantity_L, LOG_Minimum_bin_quantity_L, LOG_Control_quantity_L, LOG_Replenishment_qty_L
                                      , LOG_Period_ind_For_SLED_L, LOG_Total_Shelf_life_L, LOG_Min_Rem_Shelf_Life_L, LOG_Capacity_Usage_L, LOG_Unit_Of_Measure_X_D_L, LOG_Unit_Of_Measure_AUN_A_L, LOG_Unit_Of_Measure_Y_N_L, LOG_Unit_Of_Measure_Bun_B_L, LOG_Stock_removal_L);

            if (TaskAPI.IsAllowSubmit)
            {
                switch (Action)
                {
                    case "C":
                        SetEnable(true, LOG_Capacity_Usage, LOG_Cc_Fixed, LOG_Cc_phys, LOG_Coefficient_Of_Logistic, LOG_LoadingGrp, LOG_Storage_Location, LOG_Weight_Unit, LOG_Net_Weight
                                      , LOG_Gross_Weight, LOG_Volume_Unit, LOG_Volume, LOG_Trans_Grp, LOG_Plant, LOG_Unit_Of_Measure_X
                                      , LOG_Unit_Of_Measure_X_1, LOG_Unit_Of_Measure_X_2, LOG_Unit_Of_Measure_AUN, LOG_Unit_Of_Measure_AUN_1
                                      , LOG_Unit_Of_Measure_AUN_2, LOG_Unit_Of_Measure_Y, LOG_Unit_Of_Measure_Bun, LOG_Unit_Of_Measure_Bun_1
                                      , LOG_Unit_Of_Measure_Bun_2, LOG_Quantity_per_box, LOG_Transportation_group, LOG_Warehouse_No, LOG_Storage_Type, LOG_Stock_removal
                                      , LOG_Stock_placement, LOG_Bulk_storage, LOG_Storage_Bin, LOG_Storage_Section_Ind, LOG_LE_quantity1, LOG_LE_quantity2
                                      , LOG_LE_quantity3, LOG_SUT1, LOG_SUT2, LOG_SUT3, LOG_Maximum_bin_quantity, LOG_Minimum_bin_quantity, LOG_Control_quantity
                                      , LOG_Replenishment_qty, LOG_Unit_Of_Measure_X_D_1, LOG_Unit_Of_Measure_AUN_A_1, LOG_Unit_Of_Measure_Y_N_1, LOG_Unit_Of_Measure_Bun_B_1);
                        SetForeColor(Color.Blue, LOG_Total_Shelf_life_L, LOG_Cc_Phys_L, LOG_Coefficient_Of_Logistic_L, LOG_LoadingGrp_L, LOG_Unit_Of_Measure_L, LOG_Unit_Of_Measure_X_L
                                               , LOG_Unit_Of_Measure_AUN_L, LOG_Unit_Of_Measure_Y_L, LOG_Unit_Of_Measure_Bun_L
                                               , LOG_Quantity_per_box_L, LOG_Transportation_group_L, LOG_Warehouse_No_L, LOG_Storage_Type_L, LOG_Stock_placement_L, LOG_Stock_removal_L
                                               , LOG_Unit_Of_Measure_X_D_L, LOG_Unit_Of_Measure_AUN_A_L, LOG_Unit_Of_Measure_Y_N_L, LOG_Unit_Of_Measure_Bun_B_L);

                        if (Category == "FINI")
                        {
                            if (FORM == "FORM-012")
                            {
                                SetForeColor(Color.Blue, LOG_Coefficient_Of_Logistic_L, LOG_LoadingGrp_L);
                            }
                            else
                            {
                                SetForeColor(Color.Blue, LOG_Coefficient_Of_Logistic_L, LOG_LoadingGrp_L, LOG_Storage_Location_L, LOG_Plant_L);
                            }

                            if (FORM == "FORM-074")
                            {
                                SetForeColor(Color.Blue, LOG_Coefficient_Of_Logistic_L, LOG_LoadingGrp_L, LOG_Gross_Weight_L, LOG_Net_Weight_L, LOG_Volume_L);
                                SetForeColor(Color.Black, LOG_Unit_Of_Measure_L, LOG_Unit_Of_Measure_X, LOG_Unit_Of_Measure_X_L, LOG_Unit_Of_Measure_AUN,
                                                          LOG_Unit_Of_Measure_AUN_L, LOG_Unit_Of_Measure_Y, LOG_Unit_Of_Measure_Y_L, LOG_Unit_Of_Measure_Bun,
                                                          LOG_Unit_Of_Measure_Bun_L);
                            }

                            if (FORM == "FORM-064" || FORM == "FORM-065-1")
                            {
                                SetForeColor(Color.Blue, this.LOG_Gross_Weight_L, this.LOG_Net_Weight_L, this.LOG_Volume_L);
                            }

                            if (FORM == "FORM-031")
                            {
                                SetForeColor(Color.Blue, this.LOG_Gross_Weight_L, this.LOG_Net_Weight_L, this.LOG_Volume_L);
                            }

                            if (FORM == "FORM-014")
                            {
                                SetForeColor(Color.Blue, LOG_Quantity_per_box_L, LOG_Gross_Weight_L, LOG_Net_Weight_L, LOG_Volume_L, LOG_Unit_Of_Measure_L);
                            }

                            if (FORM == "FORM-067")
                            {
                                SetForeColor(Color.Blue, LOG_LoadingGrp_L);
                                SetForeColor(Color.Black, LOG_Gross_Weight_L, LOG_Net_Weight_L, LOG_Unit_Of_Measure_L, LOG_Unit_Of_Measure_X_L, LOG_Unit_Of_Measure_AUN_L, LOG_Unit_Of_Measure_Y_L, LOG_Unit_Of_Measure_Bun_L);
                            }
                            if (FORM == "FORM-015")
                            {
                                SetForeColor(Color.Blue, LOG_Plant_L, LOG_Gross_Weight_L, LOG_Net_Weight_L, LOG_LoadingGrp_L);
                            }
                            if (FORM == "FORM-010")
                            {
                                SetForeColor(Color.Blue, LOG_Coefficient_Of_Logistic_L, LOG_LoadingGrp_L);
                            }
                            if (FORM == "FORM-062")
                            {
                                SetForeColor(Color.Blue, LOG_Volume_L, LOG_LoadingGrp_L);
                                SetForeColor(Color.Black, LOG_Unit_Of_Measure_AUN_L, LOG_Unit_Of_Measure_Bun_L, LOG_Unit_Of_Measure_X_L, LOG_Unit_Of_Measure_Y_L);
                            }
                            if (FORM == "FORM-T001")
                            {
                                if ((Page as PMDC).Distribute.SelectedValue == "DECO")
                                {
                                    SetForeColor(Color.Blue, LOG_Storage_Type_L);
                                }
                                SetForeColor(Color.Blue, LOG_Stock_placement_L);
                            }
                            if (FORM == "FORM-T009")
                            {
                                SetForeColor(Color.Blue, LOG_Stock_placement_L, LOG_Storage_Type_L);
                                SetForeColor(Color.Black, LOG_Total_Shelf_life_L);
                            }
                            if (FORM == "FORM-T012")
                            {
                                SetForeColor(Color.Blue, LOG_Total_Shelf_life_L, LOG_Stock_placement_L, LOG_Storage_Section_Ind_L);
                            }
                            if (FORM == "FORM-T006")
                            {
                                SetForeColor(Color.Blue, LOG_Cc_Phys_L, LOG_Storage_Type_L, LOG_Stock_placement_L);
                            }
                            if (FORM == "FORM-TW-003" || FORM == "FORM-TW-011" || FORM == "FORM-TW-004")
                            {
                                SetForeColor(Color.Blue, LOG_Volume_L);
                                SetForeColor(Color.Black, LOG_Total_Shelf_life_L);
                            }
                            if (FORM == "FORM-TW-010" || FORM == "FORM-TW-007")
                            {
                                SetForeColor(Color.Blue, LOG_Storage_Section_Ind_L);
                            }
                            if (FORM == "FORM-T010")
                            {
                                SetForeColor(Color.Blue, LOG_Stock_placement_L, LOG_Cc_Phys_L, LOG_Total_Shelf_life_L);
                            }
                            if (FORM == "FORM-T018")
                            {
                                if ((Page as PMDC).TabMaterial2.Planning1.PLA_Storage_Location.Text == "0010, Finished Gds")
                                {
                                    SetForeColor(Color.Blue, LOG_Storage_Type_L, LOG_Stock_removal_L, LOG_Stock_placement_L, LOG_Storage_Section_Ind_L);
                                }
                                else
                                {
                                    SetForeColor(Color.Black, LOG_Storage_Type_L, LOG_Stock_removal_L, LOG_Stock_placement_L, LOG_Storage_Section_Ind_L);
                                }

                                SetForeColor(Color.Black, LOG_Total_Shelf_life_L);
                            }
                        }

                        SetDefaultValue();
                        break;
                    case "S":
                        SetEnable(false, LOG_Capacity_Usage, LOG_Cc_Fixed, LOG_Cc_phys, LOG_Unit_Of_Measure_Y_2, LOG_Unit_Of_Measure_Y_1, LOG_Coefficient_Of_Logistic, LOG_LoadingGrp
                                       , LOG_Storage_Location, LOG_Weight_Unit, LOG_Net_Weight, LOG_Gross_Weight, LOG_Volume_Unit, LOG_Cc_Fixed
                                       , LOG_Volume, LOG_Trans_Grp, LOG_Plant, LOG_Unit_Of_Measure_X, LOG_Unit_Of_Measure_X_1
                                       , LOG_Unit_Of_Measure_X_2, LOG_Unit_Of_Measure_AUN_1, LOG_Unit_Of_Measure_AUN_2
                                       , LOG_Unit_Of_Measure_Bun_1, LOG_Unit_Of_Measure_Bun_2, LOG_Unit_Of_Measure_AUN
                                       , LOG_Unit_Of_Measure_Y, LOG_Unit_Of_Measure_Bun, LOG_Quantity_per_box, LOG_Transportation_group, LOG_Warehouse_No, LOG_Storage_Type
                                       , LOG_Stock_placement, LOG_Bulk_storage, LOG_Storage_Bin, LOG_Storage_Section_Ind, LOG_LE_quantity1, LOG_LE_quantity2, LOG_Stock_removal
                                       , LOG_LE_quantity3, LOG_SUT1, LOG_SUT2, LOG_SUT3, LOG_Maximum_bin_quantity, LOG_Minimum_bin_quantity, LOG_Control_quantity
                                       , LOG_Total_Shelf_life, LOG_Period_ind_For_SLED, LOG_Min_Rem_Shelf_Life, LOG_Replenishment_qty, LOG_Unit_Of_Measure_X_D_1, LOG_Unit_Of_Measure_AUN_A_1, LOG_Unit_Of_Measure_Y_N_1, LOG_Unit_Of_Measure_Bun_B_1);
                        SetDefaultValue();
                        SetForeColor(Color.Black, LOG_Gross_Weight_L, LOG_Net_Weight_L, LOG_Cc_Phys_L, LOG_Volume_L, LOG_Coefficient_Of_Logistic_L, LOG_LoadingGrp_L, LOG_Storage_Location_L, LOG_Weight_Unit_L
                                       , LOG_Net_Weight_L, LOG_Gross_Weight_L, LOG_Volume_Unit_L, LOG_Volume_L, LOG_Trans_Grp_L, LOG_Cc_Fixed_L
                                       , LOG_Unit_Of_Measure_L, LOG_Unit_Of_Measure_X_L, LOG_Unit_Of_Measure_AUN_L, LOG_Unit_Of_Measure_Y_L
                                       , LOG_Unit_Of_Measure_Bun_L, LOG_Quantity_per_box_L, LOG_Transportation_group_L, LOG_Warehouse_No_L, LOG_Storage_Type_L, LOG_Stock_placement_L
                                       , LOG_Bulk_storage_L, LOG_Storage_Bin_L, LOG_Storage_Section_Ind_L, LOG_LE_quantity1_L, LOG_LE_quantity2_L, LOG_LE_quantity3_L
                                       , LOG_SUT1_L, LOG_SUT2_L, LOG_SUT3_L, LOG_Maximum_bin_quantity_L, LOG_Minimum_bin_quantity_L, LOG_Control_quantity_L, LOG_Replenishment_qty_L
                                       , LOG_Period_ind_For_SLED_L, LOG_Total_Shelf_life_L, LOG_Min_Rem_Shelf_Life_L, LOG_Capacity_Usage_L, LOG_Unit_Of_Measure_X_D_L, LOG_Unit_Of_Measure_AUN_A_L, LOG_Unit_Of_Measure_Y_N_L, LOG_Unit_Of_Measure_Bun_B_L, LOG_Stock_removal_L);

                        break;

                    case "E":
                        SetEnable(true, LOG_Capacity_Usage, LOG_Cc_Fixed, LOG_Cc_phys, LOG_Unit_Of_Measure_Y_2, LOG_Unit_Of_Measure_Y_1, LOG_Coefficient_Of_Logistic, LOG_LoadingGrp, LOG_Storage_Location
                                      , LOG_Weight_Unit, LOG_Net_Weight, LOG_Gross_Weight, LOG_Volume_Unit, LOG_Volume, LOG_Trans_Grp, LOG_Plant, LOG_Cc_Fixed
                                      , LOG_Unit_Of_Measure_X, LOG_Unit_Of_Measure_AUN, LOG_Unit_Of_Measure_Y, LOG_Unit_Of_Measure_Bun
                                      , LOG_Quantity_per_box, LOG_Unit_Of_Measure_X_1, LOG_Unit_Of_Measure_X_2, LOG_Unit_Of_Measure_AUN_1
                                      , LOG_Unit_Of_Measure_AUN_2, LOG_Unit_Of_Measure_Bun_1, LOG_Unit_Of_Measure_Bun_2, LOG_Transportation_group, LOG_Warehouse_No, LOG_Storage_Type
                                      , LOG_Stock_placement, LOG_Bulk_storage, LOG_Storage_Bin, LOG_Storage_Section_Ind, LOG_LE_quantity1, LOG_LE_quantity2, LOG_Stock_removal
                                      , LOG_LE_quantity3, LOG_SUT1, LOG_SUT2, LOG_SUT3, LOG_Maximum_bin_quantity, LOG_Minimum_bin_quantity, LOG_Control_quantity
                                      , LOG_Replenishment_qty, LOG_Unit_Of_Measure_X_D_1, LOG_Unit_Of_Measure_AUN_A_1, LOG_Unit_Of_Measure_Y_N_1, LOG_Unit_Of_Measure_Bun_B_1);
                        SetForeColor(Color.Black, LOG_Gross_Weight_L, LOG_Net_Weight_L, LOG_Cc_Phys_L, LOG_Volume_L, LOG_Coefficient_Of_Logistic_L, LOG_LoadingGrp_L, LOG_Storage_Location_L, LOG_Weight_Unit_L
                                      , LOG_Net_Weight_L, LOG_Gross_Weight_L, LOG_Volume_Unit_L, LOG_Volume_L, LOG_Trans_Grp_L, LOG_Cc_Fixed_L
                                      , LOG_Unit_Of_Measure_L, LOG_Unit_Of_Measure_X_L, LOG_Unit_Of_Measure_AUN_L, LOG_Unit_Of_Measure_Y_L
                                      , LOG_Unit_Of_Measure_Bun_L, LOG_Quantity_per_box_L, LOG_Transportation_group_L, LOG_Warehouse_No_L, LOG_Storage_Type_L, LOG_Stock_placement_L
                                      , LOG_Bulk_storage_L, LOG_Storage_Bin_L, LOG_Storage_Section_Ind_L, LOG_LE_quantity1_L, LOG_LE_quantity2_L, LOG_LE_quantity3_L
                                      , LOG_SUT1_L, LOG_SUT2_L, LOG_SUT3_L, LOG_Maximum_bin_quantity_L, LOG_Minimum_bin_quantity_L, LOG_Control_quantity_L, LOG_Replenishment_qty_L
                                      , LOG_Period_ind_For_SLED_L, LOG_Total_Shelf_life_L, LOG_Min_Rem_Shelf_Life_L, LOG_Capacity_Usage_L, LOG_Unit_Of_Measure_X_D_L, LOG_Unit_Of_Measure_AUN_A_L, LOG_Unit_Of_Measure_Y_N_L, LOG_Unit_Of_Measure_Bun_B_L, LOG_Stock_removal_L);
                        SetForeColor(Color.Blue, LOG_Plant_L);

                        if (TaskAPI.Process == "Return Goods Application" && TaskAPI.Step == "Logistic")
                        {
                            SetForeColor(Color.Black, LOG_Plant_L);
                        }
                        if (TaskAPI.Process == "HK-MTO Base Code Application" && TaskAPI.Step == "HK Marketing" && FORM == "FORM-067")
                        {
                            SetForeColor(Color.Blue, LOG_LoadingGrp_L);
                        }
                        if (TaskAPI.Process == "Trade Code Application" && TaskAPI.Step == "Fill in the request")
                        {
                            SetForeColor(Color.Blue, LOG_LoadingGrp_L);
                        }
                        SetDefaultValue();
                        break;
                }
            }
            else
            {
                SetEnable(false, LOG_Transportation_group, LOG_Warehouse_No, LOG_Stock_placement, LOG_Stock_removal, LOG_Storage_Type, LOG_Bulk_storage, LOG_Capacity_Usage, LOG_Cc_Fixed, LOG_Cc_phys, LOG_Coefficient_Of_Logistic, LOG_LoadingGrp, LOG_Storage_Location, LOG_Weight_Unit, LOG_Net_Weight, LOG_Gross_Weight, LOG_Volume_Unit, LOG_Volume, LOG_Trans_Grp, LOG_Plant, LOG_Unit_Of_Measure_X, LOG_Unit_Of_Measure_AUN, LOG_Unit_Of_Measure_Y, LOG_Unit_Of_Measure_Bun, LOG_Quantity_per_box);
            }
            //魏军添加 控制dropdownlist的enable属性
            string item = "";
            string value = "";
            bool flag_2 = false;
            foreach (Control cr in this.Controls)
            {
                if (cr is DropDownList)
                {
                    DropDownList tb = (DropDownList)cr;
                    if (!tb.Enabled)
                    {

                        try
                        {
                            item = tb.SelectedItem.Text;
                            value = tb.SelectedValue.ToString();
                        }
                        catch (Exception)
                        {
                            flag_2 = true;

                        }
                        if (!flag_2)
                        {
                            tb.Enabled = true;
                            tb.Items.Clear();
                            tb.Items.Add(new ListItem(item, value));
                            tb.SelectedIndex = 0;
                            tb.ForeColor = System.Drawing.Color.DimGray;
                        }
                    }

                }
            }
        }
        #endregion

        #region 方法 InitDropdownList(初始化下拉框数据源)
        private void InitDropDownList()
        {
            LOG_LoadingGrp.Items.Clear();
            LOG_LoadingGrp.Items.Add(new ListItem("", ""));
            IList<m_LoadingGroup> lgs = (m_LoadingGroup.status == 1).List<m_LoadingGroup>();
            foreach (m_LoadingGroup lg in lgs)
            {
                LOG_LoadingGrp.Items.Add(new ListItem(lg.Loading_Group + ", " + lg.Description, lg.Loading_Group));
            }

            LOG_Plant.Items.Clear();
            LOG_Plant.Items.Add(new ListItem("", ""));
            IList<m_Plant> dlts = (m_Plant.status == 1 & m_Plant.categary == (FORM == "FORM-001" || FORM == "FORM-065-1" || FORM == "FORM-065-2" ? "D" : "P")).List<m_Plant>();
            foreach (m_Plant dlt in dlts)
            {
                LOG_Plant.Items.Add(new ListItem(dlt.PlantName, dlt.PlantName));
            }

            LOG_Stock_placement.Items.Clear();
            LOG_Stock_placement.Items.Add(new ListItem("", ""));
            IList<m_TW_Stock_placement> srs = (m_TW_Stock_placement.status == 1).List<m_TW_Stock_placement>();
            foreach (m_TW_Stock_placement sr in srs)
            {
                LOG_Stock_placement.Items.Add(new ListItem(sr.Stock_placement + ", " + sr.Description, sr.Stock_placement));
            }
        }

        #endregion

        #region 方法 InitShowHide(初始化控件显示)
        private void InitShowHide()
        {
            #region 设置禁启用
            SetVisible(false, LOG_Capacity_Usage, LOG_Capacity_Usage_L, LOG_Cc_Fixed, LOG_Cc_Fixed_L, LOG_Cc_phys, LOG_Cc_Phys_L, LOG_Coefficient_Of_Logistic, LOG_LoadingGrp, LOG_Storage_Location, LOG_Weight_Unit, LOG_Net_Weight, LOG_Gross_Weight, LOG_Volume_Unit, LOG_Volume, LOG_Trans_Grp
                            , LOG_Coefficient_Of_Logistic_L, LOG_LoadingGrp_L, LOG_Storage_Location_L, LOG_Weight_Unit_L, LOG_Net_Weight_L, LOG_Gross_Weight_L, LOG_Volume_Unit_L, LOG_Volume_L
                            , LOG_Trans_Grp_L, LOG_Plant_L, LOG_Plant, LOG_Unit_Of_Measure_L, LOG_Unit_Of_Measure_X, LOG_Unit_Of_Measure_AUN, LOG_Unit_Of_Measure_Y, LOG_Unit_Of_Measure_X_L
                            , LOG_Unit_Of_Measure_AUN_L, LOG_Unit_Of_Measure_Y_L, LOG_Unit_Of_Measure_Bun, LOG_Unit_Of_Measure_Bun_L, LOG_Quantity_per_box, LOG_Quantity_per_box_L
                            , LOG_Unit_Of_Measure_Bun_1, LOG_Unit_Of_Measure_Bun_2, LOG_Unit_Of_Measure_AUN_1, LOG_Unit_Of_Measure_AUN_2, LOG_Unit_Of_Measure_X_1, LOG_Unit_Of_Measure_X_2
                            , LOG_Unit_Of_Measure_Y_1, LOG_Unit_Of_Measure_Y_2, LOG_Transportation_group, LOG_Transportation_group_L, LOG_Transportation_group, LOG_Warehouse_No, LOG_Warehouse_No_L
                            , LOG_Storage_Type, LOG_Storage_Type_L, LOG_Stock_placement, LOG_Stock_placement_L, LOG_Bulk_storage, LOG_Bulk_storage_L, LOG_Storage_Bin, LOG_Stock_removal_L, LOG_Stock_removal
                            , LOG_Storage_Bin_L, LOG_Storage_Section_Ind, LOG_Storage_Section_Ind_L, LOG_LE_quantity1, LOG_LE_quantity1_L, LOG_LE_quantity2, LOG_LE_quantity2_L
                            , LOG_LE_quantity3, LOG_LE_quantity3_L, LOG_SUT1, LOG_SUT1_L, LOG_SUT2, LOG_SUT2_L, LOG_SUT3, LOG_SUT3_L, LOG_Maximum_bin_quantity, LOG_Maximum_bin_quantity_L
                            , LOG_Minimum_bin_quantity, LOG_Minimum_bin_quantity_L, LOG_Control_quantity, LOG_Control_quantity_L, LOG_Replenishment_qty, LOG_Replenishment_qty_L
                            , LOG_Unit_Of_Measure_X_D_L, LOG_Unit_Of_Measure_AUN_A_L, LOG_Unit_Of_Measure_Y_N_L, LOG_Unit_Of_Measure_Bun_B_L, LOG_Unit_Of_Measure_X_D_1
                            , LOG_Unit_Of_Measure_AUN_A_1, LOG_Unit_Of_Measure_Y_N_1, LOG_Unit_Of_Measure_Bun_B_1, LOG_Period_ind_For_SLED, LOG_Period_ind_For_SLED_L, LOG_Total_Shelf_life, LOG_Total_Shelf_life_L, LOG_Min_Rem_Shelf_Life, LOG_Min_Rem_Shelf_Life_L
                            , LOG_Unit_Of_Measure_X_D_2, LOG_Unit_Of_Measure_AUN_A_2, LOG_Unit_Of_Measure_Y_N_2, LOG_Unit_Of_Measure_Bun_B_2
                            , LOG_Unit_Of_Measure_X_D_3, LOG_Unit_Of_Measure_AUN_A_3, LOG_Unit_Of_Measure_Y_N_3, LOG_Unit_Of_Measure_Bun_B_3);

            switch (FORM)
            {
                case "FORM-001":
                    SetVisible(true, LOG_LoadingGrp, LOG_Storage_Location, LOG_LoadingGrp_L, LOG_Storage_Location_L, LOG_Plant, LOG_Plant_L);
                    break;

                case "FORM-005":
                    SetVisible(true, LOG_Coefficient_Of_Logistic, LOG_LoadingGrp, LOG_Weight_Unit, LOG_Net_Weight, LOG_Gross_Weight, LOG_Volume_Unit, LOG_Volume, LOG_Trans_Grp
                                   , LOG_Coefficient_Of_Logistic_L, LOG_LoadingGrp_L, LOG_Weight_Unit_L, LOG_Net_Weight_L, LOG_Gross_Weight_L, LOG_Volume_Unit_L, LOG_Volume_L, LOG_Trans_Grp_L);
                    break;
                //TB添加 from-077
                case "FORM-077":
                    SetVisible(true, LOG_Coefficient_Of_Logistic, LOG_LoadingGrp, LOG_Weight_Unit, LOG_Net_Weight, LOG_Gross_Weight, LOG_Volume_Unit, LOG_Volume, LOG_Trans_Grp
                                  , LOG_Coefficient_Of_Logistic_L, LOG_LoadingGrp_L, LOG_Weight_Unit_L, LOG_Net_Weight_L, LOG_Gross_Weight_L, LOG_Volume_Unit_L, LOG_Volume_L, LOG_Trans_Grp_L);
                    break;
                case "FORM-012":
                case "FORM-074":
                case "FORM-064":
                case "FORM-065-1":
                case "FORM-065-2":
                    if (FORM == "FORM-064" || FORM == "FORM-065-1" || FORM == "FORM-065-2" || FORM == "FORM-074")     //Form-064 HK Trade Code V2.0 100925.xls
                    {
                        LOG_Title.Text = "&nbsp;";
                    }

                    SetVisible(FORM == "FORM-064", LOG_Unit_Of_Measure_L, LOG_Unit_Of_Measure_X, LOG_Unit_Of_Measure_AUN, LOG_Unit_Of_Measure_Y, LOG_Unit_Of_Measure_X_L, LOG_Unit_Of_Measure_AUN_L, LOG_Unit_Of_Measure_Y_L, LOG_Unit_Of_Measure_Bun, LOG_Unit_Of_Measure_Bun_L);
                    SetVisible(true, LOG_Coefficient_Of_Logistic, LOG_LoadingGrp, LOG_Storage_Location, LOG_Weight_Unit, LOG_Net_Weight, LOG_Gross_Weight, LOG_Volume_Unit, LOG_Volume, LOG_Trans_Grp
                                   , LOG_Coefficient_Of_Logistic_L, LOG_LoadingGrp_L, LOG_Storage_Location_L, LOG_Weight_Unit_L, LOG_Net_Weight_L, LOG_Gross_Weight_L, LOG_Volume_Unit_L, LOG_Volume_L, LOG_Trans_Grp_L);

                    if (FORM == "FORM-064")
                    {
                        SetVisible(false, LOG_Coefficient_Of_Logistic, LOG_Coefficient_Of_Logistic_L, LOG_Storage_Location, LOG_Storage_Location_L);
                    }

                    if (FORM == "FORM-074")
                    {
                        SetVisible(true, LOG_Unit_Of_Measure_L, LOG_Unit_Of_Measure_X, LOG_Unit_Of_Measure_AUN, LOG_Unit_Of_Measure_Y, LOG_Unit_Of_Measure_X_L, LOG_Unit_Of_Measure_AUN_L, LOG_Unit_Of_Measure_Y_L, LOG_Unit_Of_Measure_Bun_L, LOG_Unit_Of_Measure_Bun);
                        SetVisible(false, LOG_Coefficient_Of_Logistic, LOG_Coefficient_Of_Logistic_L, LOG_Storage_Location, LOG_Storage_Location_L);
                    }

                    if (FORM == "FORM-065-1")
                    {
                        SetVisible(true, LOG_Quantity_per_box, LOG_Quantity_per_box_L, LOG_Unit_Of_Measure_L, LOG_Unit_Of_Measure_X, LOG_Unit_Of_Measure_AUN,
                                         LOG_Unit_Of_Measure_Y, LOG_Unit_Of_Measure_X_L, LOG_Unit_Of_Measure_AUN_L, LOG_Unit_Of_Measure_Y_L, LOG_Unit_Of_Measure_Bun_L,
                                         LOG_Unit_Of_Measure_Bun, LOG_Plant, LOG_Plant_L);

                        SetVisible(false, LOG_Coefficient_Of_Logistic, LOG_Coefficient_Of_Logistic_L);
                    }

                    if (FORM == "FORM-065-2")
                    {
                        SetVisible(true, LOG_Trans_Grp, LOG_Trans_Grp_L, LOG_LoadingGrp, LOG_LoadingGrp_L, LOG_Plant, LOG_Plant_L);

                        SetVisible(false, LOG_Coefficient_Of_Logistic, LOG_Coefficient_Of_Logistic_L, LOG_Storage_Location, LOG_Storage_Location_L,
                                          LOG_Gross_Weight, LOG_Gross_Weight_L, LOG_Net_Weight, LOG_Net_Weight_L, LOG_Weight_Unit, LOG_Weight_Unit_L,
                                          LOG_Volume, LOG_Volume_L, LOG_Volume_Unit, LOG_Volume_Unit_L);
                    }
                    break;

                case "FORM-031-1":
                    LOG_Title.Text = "&nbsp;";
                    SetVisible(true, LOG_Gross_Weight, LOG_Weight_Unit, LOG_Net_Weight, LOG_Volume_Unit, LOG_Volume, LOG_Trans_Grp, LOG_LoadingGrp, LOG_Gross_Weight_L, LOG_Weight_Unit_L, LOG_Net_Weight_L, LOG_Volume_Unit_L, LOG_Volume_L, LOG_Trans_Grp_L, LOG_LoadingGrp_L);
                    SetVisible(false, LOG_Coefficient_Of_Logistic, LOG_Coefficient_Of_Logistic_L, LOG_Storage_Location, LOG_Storage_Location_L, LOG_Unit_Of_Measure_Bun, LOG_Unit_Of_Measure_Bun_1, LOG_Unit_Of_Measure_Bun_2, LOG_Unit_Of_Measure_AUN, LOG_Unit_Of_Measure_AUN_1, LOG_Unit_Of_Measure_AUN_2, LOG_Unit_Of_Measure_X, LOG_Unit_Of_Measure_X_1, LOG_Unit_Of_Measure_X_2, LOG_Unit_Of_Measure_Y, LOG_Unit_Of_Measure_Y_1, LOG_Unit_Of_Measure_Y_2);
                    break;
                case "FORM-031-2":
                    LOG_Title.Text = "&nbsp;";
                    SetVisible(true, LOG_Gross_Weight, LOG_Weight_Unit, LOG_Net_Weight, LOG_Volume_Unit, LOG_Volume, LOG_Trans_Grp, LOG_LoadingGrp, LOG_Gross_Weight_L, LOG_Weight_Unit_L, LOG_Net_Weight_L, LOG_Volume_Unit_L, LOG_Volume_L, LOG_Trans_Grp_L, LOG_LoadingGrp_L);
                    SetVisible(false, LOG_Coefficient_Of_Logistic, LOG_Coefficient_Of_Logistic_L, LOG_Storage_Location, LOG_Storage_Location_L, LOG_Unit_Of_Measure_Bun, LOG_Unit_Of_Measure_Bun_1, LOG_Unit_Of_Measure_Bun_2, LOG_Unit_Of_Measure_AUN, LOG_Unit_Of_Measure_AUN_1, LOG_Unit_Of_Measure_AUN_2, LOG_Unit_Of_Measure_X, LOG_Unit_Of_Measure_X_1, LOG_Unit_Of_Measure_X_2, LOG_Unit_Of_Measure_Y, LOG_Unit_Of_Measure_Y_1, LOG_Unit_Of_Measure_Y_2);
                    break;
                case "FORM-014":
                    LOG_Title.Text = "&nbsp;";
                    SetVisible(true, LOG_Quantity_per_box, LOG_Gross_Weight, LOG_Net_Weight, LOG_Volume, LOG_Volume_Unit
                                   , LOG_Weight_Unit, LOG_Unit_Of_Measure_L, LOG_Unit_Of_Measure_X_L, LOG_Unit_Of_Measure_AUN_L
                                   , LOG_Unit_Of_Measure_Y_L, LOG_Unit_Of_Measure_Bun_L, LOG_Unit_Of_Measure_X
                                   , LOG_Unit_Of_Measure_AUN, LOG_Unit_Of_Measure_Y, LOG_Unit_Of_Measure_Bun
                                   , LOG_Trans_Grp, LOG_LoadingGrp, LOG_Trans_Grp_L, LOG_LoadingGrp_L
                                   , LOG_Quantity_per_box_L, LOG_Gross_Weight_L, LOG_Net_Weight_L
                                   , LOG_Volume_L, LOG_Volume_Unit_L, LOG_Weight_Unit_L
                                   , LOG_Storage_Location, LOG_Storage_Location_L, LOG_Unit_Of_Measure_AUN_1, LOG_Unit_Of_Measure_AUN_2
                                   , LOG_Unit_Of_Measure_Bun_1, LOG_Unit_Of_Measure_Bun_2, LOG_Unit_Of_Measure_X_1, LOG_Unit_Of_Measure_X_2
                                   , LOG_Unit_Of_Measure_Y_1, LOG_Unit_Of_Measure_Y_2);
                    break;
                case "FORM-067":
                    LOG_Title.Text = "&nbsp;";
                    SetVisible(true, LOG_LoadingGrp, LOG_Weight_Unit, LOG_Net_Weight, LOG_Gross_Weight, LOG_Volume_Unit, LOG_Volume, LOG_Trans_Grp
                                   , LOG_LoadingGrp_L, LOG_Weight_Unit_L, LOG_Net_Weight_L, LOG_Gross_Weight_L, LOG_Volume_Unit_L, LOG_Volume_L, LOG_Trans_Grp_L);

                    break;
                case "FORM-015":
                    LOG_Title.Text = "&nbsp;";
                    SetVisible(true, LOG_Unit_Of_Measure_L, LOG_LoadingGrp, LOG_Weight_Unit, LOG_Net_Weight, LOG_Gross_Weight, LOG_Volume_Unit, LOG_Volume, LOG_Trans_Grp
                                   , LOG_Unit_Of_Measure_X_1, LOG_Unit_Of_Measure_X_2, LOG_Unit_Of_Measure_AUN_1, LOG_Unit_Of_Measure_AUN_2, LOG_Unit_Of_Measure_Bun_1, LOG_Unit_Of_Measure_Bun_2
                                   , LOG_LoadingGrp_L, LOG_Weight_Unit_L, LOG_Net_Weight_L, LOG_Gross_Weight_L, LOG_Volume_Unit_L, LOG_Volume_L, LOG_Trans_Grp_L
                                   , LOG_Unit_Of_Measure_AUN, LOG_Unit_Of_Measure_AUN_L, LOG_Unit_Of_Measure_Bun, LOG_Unit_Of_Measure_Bun_L, LOG_Unit_Of_Measure_X
                                   , LOG_Unit_Of_Measure_X_L, LOG_Unit_Of_Measure_Y, LOG_Unit_Of_Measure_Y_L, LOG_Unit_Of_Measure_Y_1, LOG_Unit_Of_Measure_Y_2);
                    break;
                case "FORM-010":
                    SetVisible(true, LOG_Coefficient_Of_Logistic, LOG_Coefficient_Of_Logistic_L, LOG_LoadingGrp, LOG_LoadingGrp_L, LOG_Trans_Grp, LOG_Trans_Grp_L);
                    break;
                case "FORM-062":
                    LOG_Title.Text = "&nbsp;";
                    SetVisible(true, LOG_Unit_Of_Measure_L, LOG_LoadingGrp, LOG_Weight_Unit, LOG_Net_Weight, LOG_Gross_Weight, LOG_Volume_Unit, LOG_Volume, LOG_Trans_Grp
                                   , LOG_LoadingGrp_L, LOG_Weight_Unit_L, LOG_Net_Weight_L, LOG_Gross_Weight_L, LOG_Volume_Unit_L, LOG_Volume_L, LOG_Trans_Grp_L
                                   , LOG_Unit_Of_Measure_AUN, LOG_Unit_Of_Measure_AUN_L, LOG_Unit_Of_Measure_Bun, LOG_Unit_Of_Measure_Bun_L, LOG_Unit_Of_Measure_X
                                   , LOG_Unit_Of_Measure_X_L, LOG_Unit_Of_Measure_Y, LOG_Unit_Of_Measure_Y_L);
                    break;
                case "FORM-T001":
                    //LOG_Title.Text = "&nbsp;";
                    SetVisible(true, LOG_Volume_L, LOG_Volume, LOG_Volume_Unit, LOG_Volume_Unit_L
                                   , LOG_Unit_Of_Measure_L, LOG_Transportation_group, LOG_Transportation_group_L, LOG_Transportation_group, LOG_Warehouse_No, LOG_Warehouse_No_L
                                   , LOG_Storage_Type, LOG_Storage_Type_L, LOG_Stock_placement, LOG_Stock_placement_L, LOG_Bulk_storage, LOG_Bulk_storage_L
                                   , LOG_Storage_Section_Ind, LOG_Storage_Section_Ind_L, LOG_LE_quantity1, LOG_LE_quantity1_L, LOG_LE_quantity2, LOG_LE_quantity2_L
                                   , LOG_LE_quantity3, LOG_LE_quantity3_L, LOG_SUT1, LOG_SUT1_L, LOG_SUT2, LOG_SUT2_L, LOG_SUT3, LOG_SUT3_L
                                   , LOG_Unit_Of_Measure_X_D_L, LOG_Unit_Of_Measure_AUN_A_L, LOG_Unit_Of_Measure_Y_N_L, LOG_Unit_Of_Measure_Bun_B_L, LOG_Unit_Of_Measure_X_D_1
                                   , LOG_Unit_Of_Measure_AUN_A_1, LOG_Unit_Of_Measure_Y_N_1, LOG_Unit_Of_Measure_Bun_B_1, LOG_Stock_removal_L, LOG_Stock_removal, LOG_LoadingGrp, LOG_LoadingGrp_L);
                    if (LOG_Storage_Type.SelectedValue == "P01")
                    {
                        SetVisible(true, LOG_Storage_Bin, LOG_Storage_Bin_L, LOG_Maximum_bin_quantity, LOG_Maximum_bin_quantity_L, LOG_Control_quantity
                                       , LOG_Control_quantity_L, LOG_Minimum_bin_quantity, LOG_Minimum_bin_quantity_L, LOG_Replenishment_qty, LOG_Replenishment_qty_L);
                    }
                    else
                    {
                        SetVisible(false, LOG_Storage_Bin, LOG_Storage_Bin_L, LOG_Maximum_bin_quantity, LOG_Maximum_bin_quantity_L, LOG_Control_quantity
                                        , LOG_Control_quantity_L, LOG_Minimum_bin_quantity, LOG_Minimum_bin_quantity_L, LOG_Replenishment_qty, LOG_Replenishment_qty_L);
                    }
                    break;
                case "FORM-T009":
                    //LOG_Title.Text = "&nbsp;";
                    SetVisible(true, LOG_Unit_Of_Measure_L, LOG_Transportation_group, LOG_Transportation_group_L, LOG_Transportation_group, LOG_Warehouse_No, LOG_Warehouse_No_L
                                   , LOG_Stock_placement, LOG_Stock_placement_L, LOG_Bulk_storage, LOG_Bulk_storage_L, LOG_Weight_Unit_L, LOG_Weight_Unit, LOG_LoadingGrp, LOG_LoadingGrp_L
                                   , LOG_Storage_Section_Ind, LOG_Storage_Section_Ind_L, LOG_LE_quantity1, LOG_LE_quantity1_L, LOG_LE_quantity2, LOG_LE_quantity2_L, LOG_Storage_Type, LOG_Storage_Type_L
                                   , LOG_LE_quantity3, LOG_LE_quantity3_L, LOG_SUT1, LOG_SUT1_L, LOG_SUT2, LOG_SUT2_L, LOG_SUT3, LOG_SUT3_L, LOG_Total_Shelf_life, LOG_Total_Shelf_life_L, LOG_Period_ind_For_SLED, LOG_Period_ind_For_SLED_L, LOG_Min_Rem_Shelf_Life, LOG_Min_Rem_Shelf_Life_L
                                   , LOG_Unit_Of_Measure_X_D_L, LOG_Unit_Of_Measure_AUN_A_L, LOG_Unit_Of_Measure_Y_N_L, LOG_Unit_Of_Measure_Bun_B_L, LOG_Unit_Of_Measure_X_D_1
                                   , LOG_Unit_Of_Measure_AUN_A_1, LOG_Unit_Of_Measure_Y_N_1, LOG_Unit_Of_Measure_Bun_B_1, LOG_Stock_removal_L, LOG_Stock_removal, LOG_Weight_Unit, LOG_Weight_Unit_L, LOG_Volume_Unit, LOG_Volume_Unit_L);
                    break;
                case "FORM-T012":
                    //LOG_Title.Text = "&nbsp;";
                    SetVisible(true, LOG_Capacity_Usage, LOG_Capacity_Usage_L, LOG_LoadingGrp, LOG_LoadingGrp_L, LOG_Transportation_group, LOG_Transportation_group_L, LOG_Transportation_group, LOG_Warehouse_No, LOG_Warehouse_No_L
                                   , LOG_Stock_placement, LOG_Stock_placement_L, LOG_Bulk_storage, LOG_Bulk_storage_L, LOG_Weight_Unit_L, LOG_Weight_Unit
                                   , LOG_LE_quantity1, LOG_LE_quantity1_L, LOG_LE_quantity2, LOG_LE_quantity2_L
                                   , LOG_LE_quantity3, LOG_LE_quantity3_L, LOG_SUT1, LOG_SUT1_L, LOG_SUT2, LOG_SUT2_L, LOG_SUT3, LOG_SUT3_L
                                   , LOG_Stock_removal_L, LOG_Stock_removal, LOG_Weight_Unit, LOG_Weight_Unit_L, LOG_Volume_Unit, LOG_Volume_Unit_L
                                   , LOG_Storage_Bin_L, LOG_Storage_Bin, LOG_Maximum_bin_quantity_L, LOG_Maximum_bin_quantity, LOG_Storage_Section_Ind, LOG_Storage_Section_Ind_L
                                   , LOG_Control_quantity_L, LOG_Control_quantity, LOG_Minimum_bin_quantity_L, LOG_Minimum_bin_quantity, LOG_Replenishment_qty_L, LOG_Replenishment_qty);

                    SetVisible(true, LOG_Storage_Type_L, LOG_Storage_Type, LOG_Total_Shelf_life, LOG_Total_Shelf_life_L, LOG_Period_ind_For_SLED, LOG_Period_ind_For_SLED_L, LOG_Min_Rem_Shelf_Life, LOG_Min_Rem_Shelf_Life_L);

                    break;
                case "FORM-T006":
                    SetVisible(true, LOG_Volume_Unit, LOG_Volume_Unit_L, LOG_Weight_Unit, LOG_Weight_Unit_L, LOG_Unit_Of_Measure_X_D_L, LOG_Unit_Of_Measure_AUN_A_L, LOG_Unit_Of_Measure_Y_N_L, LOG_Unit_Of_Measure_Bun_B_L, LOG_Unit_Of_Measure_X_D_1
                                   , LOG_Unit_Of_Measure_AUN_A_1, LOG_Unit_Of_Measure_Y_N_1, LOG_Unit_Of_Measure_Bun_B_1, LOG_Transportation_group, LOG_Transportation_group_L, LOG_LoadingGrp, LOG_LoadingGrp_L, LOG_Cc_phys, LOG_Cc_Phys_L
                                   , LOG_Cc_Fixed, LOG_Cc_Fixed_L, LOG_Unit_Of_Measure_X_D_2, LOG_Unit_Of_Measure_AUN_A_2, LOG_Unit_Of_Measure_Y_N_2, LOG_Unit_Of_Measure_Bun_B_2
                                   , LOG_Unit_Of_Measure_X_D_3, LOG_Unit_Of_Measure_AUN_A_3, LOG_Unit_Of_Measure_Y_N_3, LOG_Unit_Of_Measure_Bun_B_3);

                    SetVisible(true, LOG_Warehouse_No, LOG_Warehouse_No_L, LOG_Storage_Type, LOG_Storage_Type_L, LOG_Stock_placement, LOG_Stock_placement_L
                                       , LOG_Stock_removal, LOG_Stock_removal_L, LOG_Bulk_storage, LOG_Bulk_storage_L, LOG_Storage_Section_Ind, LOG_Storage_Section_Ind_L
                                       , LOG_LE_quantity1, LOG_LE_quantity1_L, LOG_LE_quantity2, LOG_LE_quantity2_L, LOG_LE_quantity3, LOG_LE_quantity3_L
                                       , LOG_SUT1, LOG_SUT1_L, LOG_SUT2, LOG_SUT2_L, LOG_SUT3, LOG_SUT3_L);
                    if (LOG_Storage_Type.SelectedValue == "P01")
                    {
                        SetVisible(true, LOG_Storage_Bin, LOG_Storage_Bin_L, LOG_Maximum_bin_quantity, LOG_Maximum_bin_quantity_L, LOG_Control_quantity, LOG_Control_quantity_L
                                       , LOG_Minimum_bin_quantity, LOG_Minimum_bin_quantity_L, LOG_Replenishment_qty, LOG_Replenishment_qty_L);
                    }
                    else
                    {
                        SetVisible(false, LOG_Storage_Bin, LOG_Storage_Bin_L, LOG_Maximum_bin_quantity, LOG_Maximum_bin_quantity_L, LOG_Control_quantity, LOG_Control_quantity_L
                                       , LOG_Minimum_bin_quantity, LOG_Minimum_bin_quantity_L, LOG_Replenishment_qty, LOG_Replenishment_qty_L);
                    }
                    break;
                case "FORM-TW-003":
                    //SetVisible(true, LOG_Total_Shelf_life_L, LOG_Total_Shelf_life);
                    break;
                case "FORM-TW-010":
                    SetVisible(true, LOG_Storage_Section_Ind_L, LOG_Storage_Section_Ind, LOG_Capacity_Usage, LOG_Capacity_Usage_L, LOG_Transportation_group, LOG_Transportation_group_L, LOG_LoadingGrp_L, LOG_LoadingGrp, LOG_Cc_phys, LOG_Cc_Phys_L, LOG_Cc_Fixed, LOG_Cc_Fixed_L, LOG_Min_Rem_Shelf_Life_L, LOG_Min_Rem_Shelf_Life, LOG_Total_Shelf_life, LOG_Total_Shelf_life_L, LOG_Period_ind_For_SLED_L, LOG_Period_ind_For_SLED, LOG_Warehouse_No_L, LOG_Warehouse_No
                                   , LOG_Storage_Type_L, LOG_Storage_Type, LOG_Stock_removal, LOG_Stock_removal_L, LOG_Capacity_Usage_L, LOG_Capacity_Usage, LOG_Stock_placement_L, LOG_Stock_placement, LOG_LE_quantity1_L, LOG_LE_quantity1, LOG_SUT1_L, LOG_SUT1, LOG_LE_quantity2_L, LOG_LE_quantity2, LOG_SUT2_L, LOG_SUT2, LOG_LE_quantity3_L, LOG_LE_quantity3, LOG_SUT3_L, LOG_SUT3
                                   , LOG_Weight_Unit_L, LOG_Weight_Unit, LOG_Volume_Unit, LOG_Volume_Unit_L);
                    break;

                //case "FORM-TW-007-1":TW ICD Customer Master Data
                //case "FORM-TW-004":
                //case "FORM-TW-011":
                //    SetVisible(true, LOG_Gross_Weight_L, LOG_Gross_Weight, LOG_Net_Weight_L, LOG_Net_Weight, LOG_Weight_Unit_L, LOG_Weight_Unit, LOG_Volume_L, LOG_Volume, LOG_Volume_Unit, LOG_Volume_Unit_L);
                //    break;
                case "FORM-TW-007":
                    //SetEnable(false, LOG_Storage_Section_Ind);
                    SetVisible(true, LOG_Weight_Unit_L, LOG_Weight_Unit, LOG_Volume_Unit, LOG_Volume_Unit_L
                        , LOG_Transportation_group_L, LOG_Transportation_group, LOG_LoadingGrp_L, LOG_LoadingGrp, LOG_Cc_Phys_L, LOG_Cc_phys, LOG_Cc_Fixed_L, LOG_Cc_Fixed, LOG_Warehouse_No_L, LOG_Warehouse_No
                        , LOG_Storage_Type_L, LOG_Storage_Type, LOG_Stock_placement_L, LOG_Stock_placement, LOG_Stock_removal_L, LOG_Stock_removal, LOG_Bulk_storage_L, LOG_Bulk_storage, LOG_Storage_Section_Ind_L, LOG_Storage_Section_Ind
                        , LOG_LE_quantity1_L, LOG_LE_quantity1, LOG_SUT1_L, LOG_SUT1, LOG_LE_quantity2_L, LOG_LE_quantity2, LOG_SUT2_L, LOG_SUT2, LOG_LE_quantity3_L, LOG_LE_quantity3, LOG_SUT3_L, LOG_SUT3, LOG_Storage_Bin_L, LOG_Storage_Bin, LOG_Maximum_bin_quantity_L, LOG_Maximum_bin_quantity
                        , LOG_Control_quantity_L, LOG_Control_quantity, LOG_Minimum_bin_quantity_L, LOG_Minimum_bin_quantity, LOG_Replenishment_qty_L, LOG_Replenishment_qty);
                    if ((Page as PMDC).TabMaterial3.Planning1.PLA_Plant.SelectedValue == "KT1P")
                    {
                        SetVisible(false, LOG_Warehouse_No_L, LOG_Warehouse_No, LOG_Storage_Type_L, LOG_Storage_Type, LOG_Stock_placement_L, LOG_Stock_placement, LOG_Stock_removal_L, LOG_Stock_removal, LOG_Bulk_storage_L, LOG_Bulk_storage, LOG_Storage_Section_Ind_L, LOG_Storage_Section_Ind
                        , LOG_LE_quantity1_L, LOG_LE_quantity1, LOG_SUT1_L, LOG_SUT1, LOG_LE_quantity2_L, LOG_LE_quantity2, LOG_SUT2_L, LOG_SUT2, LOG_LE_quantity3_L, LOG_LE_quantity3, LOG_SUT3_L, LOG_SUT3, LOG_Storage_Bin_L, LOG_Storage_Bin, LOG_Maximum_bin_quantity_L, LOG_Maximum_bin_quantity
                        , LOG_Control_quantity_L, LOG_Control_quantity, LOG_Minimum_bin_quantity_L, LOG_Minimum_bin_quantity, LOG_Replenishment_qty_L, LOG_Replenishment_qty);
                    }
                    break;
                case "FORM-T010":
                    SetVisible(true, LOG_Transportation_group, LOG_Transportation_group_L, LOG_LoadingGrp, LOG_LoadingGrp_L, LOG_Cc_phys, LOG_Cc_Phys_L, LOG_Cc_Fixed, LOG_Cc_Fixed_L
                                   , LOG_Min_Rem_Shelf_Life, LOG_Min_Rem_Shelf_Life_L, LOG_Total_Shelf_life, LOG_Total_Shelf_life_L, LOG_Period_ind_For_SLED, LOG_Period_ind_For_SLED_L
                                   , LOG_Warehouse_No, LOG_Warehouse_No_L, LOG_Storage_Type, LOG_Storage_Type_L, LOG_Capacity_Usage, LOG_Capacity_Usage_L, LOG_Stock_removal, LOG_Stock_removal_L
                                   , LOG_Stock_placement, LOG_Stock_placement_L, LOG_LE_quantity1, LOG_LE_quantity1_L, LOG_LE_quantity2, LOG_LE_quantity2_L, LOG_LE_quantity3, LOG_LE_quantity3_L
                                   , LOG_SUT1, LOG_SUT1_L, LOG_SUT2, LOG_SUT2_L, LOG_SUT3, LOG_SUT3_L, LOG_Weight_Unit, LOG_Weight_Unit_L, LOG_Volume_Unit, LOG_Volume_Unit_L
                                   , LOG_Storage_Section_Ind, LOG_Storage_Section_Ind_L);
                    break;
                //case "FORM-T003":
                //    SetVisible(true, LOG_Total_Shelf_life, LOG_Total_Shelf_life_L);
                //    break;
                case "FORM-T018":
                    SetVisible(true, LOG_Total_Shelf_life, LOG_Total_Shelf_life_L, LOG_Warehouse_No, LOG_Warehouse_No_L, LOG_Storage_Type, LOG_Storage_Type_L, LOG_Capacity_Usage, LOG_Capacity_Usage_L
                                   , LOG_Stock_removal, LOG_Stock_removal_L, LOG_Stock_placement, LOG_Stock_placement_L, LOG_Storage_Section_Ind, LOG_Storage_Section_Ind_L, LOG_Bulk_storage, LOG_Bulk_storage_L
                                   , LOG_LE_quantity1, LOG_LE_quantity1_L, LOG_LE_quantity2, LOG_LE_quantity2_L, LOG_LE_quantity3, LOG_LE_quantity3_L, LOG_SUT1, LOG_SUT1_L
                                   , LOG_SUT2, LOG_SUT2_L, LOG_SUT3, LOG_SUT3_L, LOG_Storage_Bin, LOG_Storage_Bin_L, LOG_Maximum_bin_quantity, LOG_Maximum_bin_quantity_L, LOG_Control_quantity, LOG_Control_quantity_L
                                   , LOG_Minimum_bin_quantity, LOG_Minimum_bin_quantity_L, LOG_Replenishment_qty, LOG_Replenishment_qty_L);
                    break;
            }

            SetToolTip();
            #endregion
        }
        #endregion

        #region 方法 Distribute,Collect(分发, 收集值)
        public void Distribute(mdc_Material mt)
        {
            //如果当前 Tabs 是隐藏的情况，退出
            if (!IsUsed)
            {
                return;
            }
            if (FORM == "FORM-TW-007")
            {
                InitShowHide();
            }
            if (FORM == "FORM-012" || FORM == "FORM-074")
            {
                PMDC pcmd = (Page as PMDC);
                if (pcmd != null)
                {
                    m_Subline sl = (m_Subline.subline == pcmd.TabMaterial1.SubLine).ListFirst<m_Subline>();
                    if (sl != null)
                    {
                        mt.LOG_Coefficient_Of_Logistic = sl.Coefficient_of_logistic;
                        mt.LOG_LoadingGrp = sl.LoadingGrp;
                    }
                }
            }
            LOG_Coefficient_Of_Logistic.Text = mt.LOG_Coefficient_Of_Logistic;
            LOG_LoadingGrp.SelectedValue = mt.LOG_LoadingGrp;
            LOG_Storage_Location.Text = mt.LOG_Storage_Location;
            LOG_Weight_Unit.SelectedValue = mt.LOG_Weight_Unit;
            LOG_Net_Weight.Text = mt.LOG_Net_Weight;
            LOG_Gross_Weight.Text = mt.LOG_Gross_Weight;
            LOG_Volume_Unit.SelectedValue = mt.LOG_Volume_Unit;
            LOG_Volume.Text = mt.LOG_Volume;
            LOG_Trans_Grp.Text = mt.LOG_Trans_Grp;
            LOG_Plant.SelectedValue = mt.LOG_Plant;
            LOG_Unit_Of_Measure_X.Text = mt.LOG_Unit_Of_Measure_X;
            LOG_Unit_Of_Measure_X_1.Text = mt.LOG_Unit_Of_Measure_X_1;
            LOG_Unit_Of_Measure_X_2.Text = mt.LOG_Unit_Of_Measure_X_2;
            LOG_Unit_Of_Measure_AUN.SelectedValue = mt.LOG_Unit_Of_Measure_AUN;
            LOG_Unit_Of_Measure_AUN_1.SelectedValue = mt.LOG_Unit_Of_Measure_AUN_1;
            LOG_Unit_Of_Measure_AUN_2.SelectedValue = mt.LOG_Unit_Of_Measure_AUN_2;
            LOG_Unit_Of_Measure_Y.Text = mt.LOG_Unit_Of_Measure_Y;
            LOG_Unit_Of_Measure_Y_1.Text = mt.LOG_Unit_Of_Measure_Y_1;
            LOG_Unit_Of_Measure_Y_2.Text = mt.LOG_Unit_Of_Measure_Y_2;
            LOG_Unit_Of_Measure_Bun.SelectedValue = mt.LOG_Unit_Of_Measure_Bun;
            LOG_Unit_Of_Measure_Bun_1.SelectedValue = mt.LOG_Unit_Of_Measure_Bun_1;
            LOG_Unit_Of_Measure_Bun_2.SelectedValue = mt.LOG_Unit_Of_Measure_Bun_2;
            LOG_Quantity_per_box.Text = mt.LOG_Quantity_per_box;
            LOG_Transportation_group.Text = mt.LOG_Transportation_group;
            LOG_Warehouse_No.Text = mt.LOG_Warehouse_No;
            LOG_Storage_Type.SelectedValue = mt.LOG_Storage_Type;
            LOG_Stock_placement.SelectedValue = mt.LOG_Stock_placement;
            LOG_Bulk_storage.Text = mt.LOG_Bulk_storage;
            LOG_Storage_Bin.Text = mt.LOG_Storage_Bin;
            LOG_Storage_Section_Ind.SelectedValue = mt.LOG_Storage_Section_Ind;
            LOG_LE_quantity1.Text = mt.LOG_LE_quantity1;
            LOG_LE_quantity2.Text = mt.LOG_LE_quantity2;
            LOG_LE_quantity3.Text = mt.LOG_LE_quantity3;
            LOG_SUT1.Text = mt.LOG_SUT1;
            LOG_SUT2.Text = mt.LOG_SUT2;
            LOG_SUT3.Text = mt.LOG_SUT3;
            LOG_Maximum_bin_quantity.Text = mt.LOG_Maximum_bin_quantity;
            LOG_Minimum_bin_quantity.Text = mt.LOG_Minimum_bin_quantity;
            LOG_Control_quantity.Text = mt.LOG_Control_quantity;
            LOG_Replenishment_qty.Text = mt.LOG_Replenishment_qty;
            LOG_Unit_Of_Measure_X_D_1.Text = mt.LOG_Unit_Of_Measure_X_D_1;
            LOG_Unit_Of_Measure_AUN_A_1.SelectedValue = mt.LOG_Unit_Of_Measure_AUN_A_1;
            LOG_Unit_Of_Measure_Y_N_1.Text = mt.LOG_Unit_Of_Measure_Y_N_1;
            LOG_Unit_Of_Measure_Bun_B_1.SelectedValue = mt.LOG_Unit_Of_Measure_Bun_B_1;
            LOG_Stock_removal.SelectedValue = mt.LOG_Stock_removal;
            LOG_Total_Shelf_life.Text = mt.LOG_Total_Shelf_life;
            LOG_Period_ind_For_SLED.Text = mt.LOG_Period_ind_For_SLED;
            LOG_Min_Rem_Shelf_Life.Text = mt.LOG_Min_Rem_Shelf_Life;

            LOG_Cc_phys.Text = mt.LOG_Cc_Phys;
            LOG_Cc_Fixed.SelectedValue = mt.LOG_Cc_Fixed;
            LOG_Capacity_Usage.Text = mt.LOG_Capacity_Usage;
            LOG_Unit_Of_Measure_X_D_2.Text = mt.LOG_Unit_Of_Measure_X_D_2;
            LOG_Unit_Of_Measure_AUN_A_2.Text = mt.LOG_Unit_Of_Measure_AUN_A_2;
            LOG_Unit_Of_Measure_Y_N_2.Text = mt.LOG_Unit_Of_Measure_Y_N_2;
            LOG_Unit_Of_Measure_Bun_B_2.Text = mt.LOG_Unit_Of_Measure_Bun_B_2;
            LOG_Unit_Of_Measure_X_D_3.Text = mt.LOG_Unit_Of_Measure_X_D_3;
            LOG_Unit_Of_Measure_AUN_A_3.Text = mt.LOG_Unit_Of_Measure_AUN_A_3;
            LOG_Unit_Of_Measure_Y_N_3.Text = mt.LOG_Unit_Of_Measure_Y_N_3;
            LOG_Unit_Of_Measure_Bun_B_3.Text = mt.LOG_Unit_Of_Measure_Bun_B_3;
        }

        public void Collect(ref mdc_Material mt)
        {
            //如果当前 Tabs 是隐藏的情况，退出
            if (!IsUsed)
            {
                return;
            }

            mt.LOG_Coefficient_Of_Logistic = LOG_Coefficient_Of_Logistic.Text;
            mt.LOG_LoadingGrp = LOG_LoadingGrp.SelectedValue;
            mt.LOG_Storage_Location = LOG_Storage_Location.Text;
            mt.LOG_Weight_Unit = LOG_Weight_Unit.SelectedValue;
            mt.LOG_Net_Weight = LOG_Net_Weight.Text;
            mt.LOG_Gross_Weight = LOG_Gross_Weight.Text;
            mt.LOG_Volume_Unit = LOG_Volume_Unit.SelectedValue;
            mt.LOG_Volume = LOG_Volume.Text;
            mt.LOG_Trans_Grp = LOG_Trans_Grp.Text;
            mt.LOG_Plant = LOG_Plant.SelectedValue;
            mt.LOG_Unit_Of_Measure_X = LOG_Unit_Of_Measure_X.Text;
            mt.LOG_Unit_Of_Measure_X_1 = LOG_Unit_Of_Measure_X_1.Text;
            mt.LOG_Unit_Of_Measure_X_2 = LOG_Unit_Of_Measure_X_2.Text;
            mt.LOG_Unit_Of_Measure_AUN = LOG_Unit_Of_Measure_AUN.SelectedValue;
            mt.LOG_Unit_Of_Measure_AUN_1 = LOG_Unit_Of_Measure_AUN_1.SelectedValue;
            mt.LOG_Unit_Of_Measure_AUN_2 = LOG_Unit_Of_Measure_AUN_2.SelectedValue;
            mt.LOG_Unit_Of_Measure_Y = LOG_Unit_Of_Measure_Y.Text;
            mt.LOG_Unit_Of_Measure_Y_1 = LOG_Unit_Of_Measure_Y_1.Text;
            mt.LOG_Unit_Of_Measure_Y_2 = LOG_Unit_Of_Measure_Y_2.Text;
            mt.LOG_Unit_Of_Measure_Bun = LOG_Unit_Of_Measure_Bun.SelectedValue;
            mt.LOG_Unit_Of_Measure_Bun_1 = LOG_Unit_Of_Measure_Bun_1.SelectedValue;
            mt.LOG_Unit_Of_Measure_Bun_2 = LOG_Unit_Of_Measure_Bun_2.SelectedValue;
            mt.LOG_Quantity_per_box = LOG_Quantity_per_box.Text;
            mt.LOG_Transportation_group = LOG_Transportation_group.Text;
            mt.LOG_Warehouse_No = LOG_Warehouse_No.Text;
            mt.LOG_Storage_Type = LOG_Storage_Type.SelectedValue;
            mt.LOG_Stock_placement = LOG_Stock_placement.SelectedValue;
            mt.LOG_Bulk_storage = LOG_Bulk_storage.Text;
            mt.LOG_Storage_Bin = LOG_Storage_Bin.Text;
            mt.LOG_Storage_Section_Ind = LOG_Storage_Section_Ind.SelectedValue;
            mt.LOG_LE_quantity1 = LOG_LE_quantity1.Text;
            mt.LOG_LE_quantity2 = LOG_LE_quantity2.Text;
            mt.LOG_LE_quantity3 = LOG_LE_quantity3.Text;
            mt.LOG_SUT1 = LOG_SUT1.Text;
            mt.LOG_SUT2 = LOG_SUT2.Text;
            mt.LOG_SUT3 = LOG_SUT3.Text;
            mt.LOG_Maximum_bin_quantity = LOG_Maximum_bin_quantity.Text;
            mt.LOG_Minimum_bin_quantity = LOG_Minimum_bin_quantity.Text;
            mt.LOG_Control_quantity = LOG_Control_quantity.Text;
            mt.LOG_Replenishment_qty = LOG_Replenishment_qty.Text;
            mt.LOG_Unit_Of_Measure_X_D_1 = LOG_Unit_Of_Measure_X_D_1.Text;
            mt.LOG_Unit_Of_Measure_AUN_A_1 = LOG_Unit_Of_Measure_AUN_A_1.SelectedValue;
            mt.LOG_Unit_Of_Measure_Y_N_1 = LOG_Unit_Of_Measure_Y_N_1.Text;
            mt.LOG_Unit_Of_Measure_Bun_B_1 = LOG_Unit_Of_Measure_Bun_B_1.SelectedValue;
            mt.LOG_Stock_removal = LOG_Stock_removal.SelectedValue;
            mt.LOG_Min_Rem_Shelf_Life = LOG_Min_Rem_Shelf_Life.Text;
            mt.LOG_Period_ind_For_SLED = LOG_Period_ind_For_SLED.Text;
            mt.LOG_Total_Shelf_life = LOG_Total_Shelf_life.Text;

            mt.LOG_Capacity_Usage = LOG_Capacity_Usage.Text;
            mt.LOG_Cc_Fixed = LOG_Cc_Fixed.SelectedValue;
            mt.LOG_Cc_Phys = LOG_Cc_phys.Text;

            mt.LOG_Unit_Of_Measure_X_D_2 = LOG_Unit_Of_Measure_X_D_2.Text;
            mt.LOG_Unit_Of_Measure_AUN_A_2 = LOG_Unit_Of_Measure_AUN_A_2.Text;
            mt.LOG_Unit_Of_Measure_Y_N_2 = LOG_Unit_Of_Measure_Y_N_2.Text;
            mt.LOG_Unit_Of_Measure_Bun_B_2 = LOG_Unit_Of_Measure_Bun_B_2.Text;
            mt.LOG_Unit_Of_Measure_X_D_3 = LOG_Unit_Of_Measure_X_D_3.Text;
            mt.LOG_Unit_Of_Measure_AUN_A_3 = LOG_Unit_Of_Measure_AUN_A_3.Text;
            mt.LOG_Unit_Of_Measure_Y_N_3 = LOG_Unit_Of_Measure_Y_N_3.Text;
            mt.LOG_Unit_Of_Measure_Bun_B_3 = LOG_Unit_Of_Measure_Bun_B_3.Text;
        }
        #endregion

        #region 方法 SetDefaultValue(设置默认值, 并禁用输入)
        public void SetDefaultValue()
        {
            LOG_Weight_Unit.SelectedValue = "KG";
            //LOG_Volume_Unit.SelectedValue = "L";
            LOG_Trans_Grp.Text = "0001";

            //LOG_Unit_Of_Measure_Y.Text    = "1";
            //LOG_Unit_Of_Measure_Y_1.Text  = "1";
            //LOG_Unit_Of_Measure_Y_2.Text  = "1";
            if (FORM == "FORM-067")
            {
                LOG_Volume_Unit.SelectedValue = "L";
            }
            if (FORM == "FORM-064")
            {
                LOG_Unit_Of_Measure_Bun_1.SelectedValue = "PC";
                LOG_Unit_Of_Measure_Bun_2.SelectedValue = "PC";
                this.LOG_LoadingGrp.SelectedValue = "3000";
                this.LOG_Unit_Of_Measure_X.Text = "1";
                this.LOG_Unit_Of_Measure_AUN.SelectedValue = "FCU";
                this.LOG_Unit_Of_Measure_Y.Text = "1";
                this.LOG_Unit_Of_Measure_Bun.SelectedValue = "PC";
                LOG_Volume_Unit.SelectedValue = "L";

                SetEnable(false, LOG_LoadingGrp, LOG_Unit_Of_Measure_X, LOG_Unit_Of_Measure_AUN, LOG_Unit_Of_Measure_Y, LOG_Unit_Of_Measure_Bun);
                SetForeColor(Color.Orange, LOG_LoadingGrp_L, LOG_Unit_Of_Measure_X_L, LOG_Unit_Of_Measure_AUN_L, LOG_Unit_Of_Measure_Y_L, LOG_Unit_Of_Measure_Bun_L, LOG_Unit_Of_Measure_L);
            }

            SetEnable(false, LOG_Weight_Unit, LOG_Volume_Unit, LOG_Trans_Grp);
            SetForeColor(Color.Orange, LOG_Weight_Unit_L, LOG_Volume_Unit_L, LOG_Trans_Grp_L);

            if (FORM == "FORM-074")
            {
                //this.LOG_Gross_Weight.Text = "";
                //this.LOG_Net_Weight.Text = "";
                this.LOG_LoadingGrp.SelectedValue = "3000";

                //SetForeColor(Color.Blue, LOG_LoadingGrp);
                LOG_Unit_Of_Measure_Bun_1.SelectedValue = "PC";
                LOG_Unit_Of_Measure_Bun_2.SelectedValue = "PC";
                SetEnable(false, LOG_LoadingGrp);
                SetForeColor(Color.Orange, LOG_LoadingGrp_L);
                LOG_Volume_Unit.SelectedValue = "L";
            }

            else if (FORM == "FORM-065-1")
            {
                LOG_Unit_Of_Measure_Bun_1.SelectedValue = "PC";
                LOG_Unit_Of_Measure_Bun_2.SelectedValue = "PC";
                this.LOG_LoadingGrp.SelectedValue = "3000";
                this.LOG_Storage_Location.Text = "0010 & 0530";
                this.LOG_Plant.SelectedValue = "K51D";
                this.LOG_Unit_Of_Measure_X.Text = "1";
                this.LOG_Unit_Of_Measure_AUN.SelectedValue = "CAR";
                this.LOG_Unit_Of_Measure_Bun.SelectedValue = "PC";
                LOG_Volume_Unit.SelectedValue = "L";

                SetEnable(false, LOG_LoadingGrp, LOG_Storage_Location, LOG_Plant, LOG_Unit_Of_Measure_X, LOG_Unit_Of_Measure_AUN, LOG_Unit_Of_Measure_Bun,
                                 LOG_Unit_Of_Measure_Y);
                SetForeColor(Color.Orange, LOG_LoadingGrp_L, LOG_Storage_Location_L, LOG_Plant_L, LOG_Unit_Of_Measure_X_L, LOG_Unit_Of_Measure_AUN_L,
                                           LOG_Unit_Of_Measure_Bun_L, LOG_Unit_Of_Measure_Y_L, LOG_Unit_Of_Measure_L);
            }

            else if (FORM == "FORM-065-2")
            {
                LOG_Unit_Of_Measure_Bun_1.SelectedValue = "PC";
                LOG_Unit_Of_Measure_Bun_2.SelectedValue = "PC";
                this.LOG_Trans_Grp.Text = "0001";
                this.LOG_LoadingGrp.SelectedValue = "3000";
                this.LOG_Plant.SelectedValue = "K51D";
                LOG_Volume_Unit.SelectedValue = "L";

                SetEnable(false, LOG_Trans_Grp, LOG_LoadingGrp, LOG_Plant);
                SetForeColor(Color.Orange, LOG_Trans_Grp_L, LOG_LoadingGrp_L, LOG_Plant_L);
            }

            else if (FORM == "FORM-031-1" || FORM == "FORM-031-2")
            {
                LOG_Unit_Of_Measure_Bun_1.SelectedValue = "PC";
                LOG_Unit_Of_Measure_Bun_2.SelectedValue = "PC";
                LOG_Weight_Unit.SelectedValue = "KG";
                LOG_Volume_Unit.SelectedValue = "L";
                LOG_Trans_Grp.Text = "0001";
                LOG_LoadingGrp.Text = "3003";
                SetEnable(false, LOG_Volume_Unit, LOG_Trans_Grp, LOG_LoadingGrp, LOG_Weight_Unit);
                SetForeColor(Color.Orange, LOG_Volume_Unit_L, LOG_Trans_Grp_L, LOG_LoadingGrp_L, LOG_Weight_Unit_L);
            }

            else if (FORM == "FORM-014")
            {
                LOG_Unit_Of_Measure_Bun_1.SelectedValue = "PC";
                LOG_Unit_Of_Measure_Bun_2.SelectedValue = "PC";
                LOG_Storage_Location.Text = "R:0530，P:0500";
                LOG_Volume_Unit.SelectedValue = "M3";
                LOG_Weight_Unit.SelectedValue = "KG";
                LOG_Unit_Of_Measure_Bun.SelectedValue = "PC";
                LOG_Trans_Grp.Text = "0001";
                LOG_LoadingGrp.SelectedValue = "3000";
                LOG_Unit_Of_Measure_X.Text = "1";
                LOG_Unit_Of_Measure_X_1.Text = "1";
                LOG_Unit_Of_Measure_Y_1.Text = "1";
                LOG_Unit_Of_Measure_AUN.SelectedValue = "CAR";
                LOG_Unit_Of_Measure_AUN_1.SelectedValue = "EA";
                SetEnable(false, LOG_Storage_Location, LOG_Volume_Unit, LOG_Weight_Unit, LOG_Unit_Of_Measure_Bun, LOG_Trans_Grp, LOG_LoadingGrp, LOG_Unit_Of_Measure_AUN, LOG_Unit_Of_Measure_AUN_1, LOG_Unit_Of_Measure_X, LOG_Unit_Of_Measure_X_1, LOG_Unit_Of_Measure_Y_1, LOG_Unit_Of_Measure_Y);
                SetForeColor(Color.Orange, LOG_Storage_Location_L, LOG_Volume_Unit_L, LOG_Weight_Unit_L, LOG_Unit_Of_Measure_Bun_L, LOG_Trans_Grp_L, LOG_LoadingGrp_L);
            }

            else if (FORM == "FORM-015")
            {
                LOG_Unit_Of_Measure_Bun_1.SelectedValue = "PC";
                LOG_Unit_Of_Measure_Bun_2.SelectedValue = "PC";
                LOG_Weight_Unit.SelectedValue = "KG";
                LOG_Volume_Unit.SelectedValue = "L";
                LOG_Trans_Grp.Text = "0001";
                //LOG_Unit_Of_Measure_X.Text = "1";
                //LOG_Unit_Of_Measure_AUN.SelectedValue = "FCU";
                LOG_Unit_Of_Measure_AUN_1.SelectedValue = "KG";
                //LOG_Unit_Of_Measure_AUN_2.SelectedValue = "L";
                LOG_Unit_Of_Measure_Bun.SelectedValue = "PC";

                //LOG_Unit_Of_Measure_Y.Text = "1";
                //LOG_Unit_Of_Measure_Y_1.Text = "1";
                //LOG_Unit_Of_Measure_Y_2.Text = "1";
                SetEnable(false, LOG_Weight_Unit, LOG_Volume_Unit, LOG_Trans_Grp, LOG_Unit_Of_Measure_AUN_1, LOG_Unit_Of_Measure_Bun, LOG_Unit_Of_Measure_Bun_1, LOG_Unit_Of_Measure_Bun_2);
                SetForeColor(Color.Orange, LOG_Weight_Unit_L, LOG_Volume_Unit_L, LOG_Trans_Grp_L);
            }
            else if (FORM == "FORM-062")
            {
                LOG_Weight_Unit.SelectedValue = "KG";
                LOG_Volume_Unit.SelectedValue = "L";
                LOG_Trans_Grp.Text = "0001";
                LOG_Unit_Of_Measure_AUN.SelectedValue = "FCU";
                LOG_Unit_Of_Measure_AUN_1.SelectedValue = "KG";
                LOG_Unit_Of_Measure_AUN_2.SelectedValue = "L";
                LOG_Unit_Of_Measure_Bun.SelectedValue = "PC";
                LOG_Unit_Of_Measure_Bun_1.SelectedValue = "PC";
                LOG_Unit_Of_Measure_Bun_2.SelectedValue = "PC";
                LOG_Unit_Of_Measure_Y.Text = "1";
                LOG_Unit_Of_Measure_Y_1.Text = "1";
                LOG_Unit_Of_Measure_Y_2.Text = "1";
                SetEnable(false, LOG_Weight_Unit, LOG_Volume_Unit, LOG_Trans_Grp, LOG_Unit_Of_Measure_AUN_1, LOG_Unit_Of_Measure_Bun, LOG_Unit_Of_Measure_Bun_1, LOG_Unit_Of_Measure_Bun_2);
                SetForeColor(Color.Orange, LOG_Weight_Unit_L, LOG_Volume_Unit_L, LOG_Trans_Grp_L);
            }
            else if (FORM == "FORM-T001")
            {
                LOG_Volume_Unit.SelectedValue = "L";
                LOG_Volume.Text = "1";
                LOG_Unit_Of_Measure_AUN_A_1.SelectedValue = "KG";
                LOG_Unit_Of_Measure_Y_N_1.Text = "1000";
                LOG_Unit_Of_Measure_Bun_B_1.SelectedValue = "PC";
                if (((Page as PMDC).Distribute.SelectedValue == "DECO"))
                {
                    LOG_Stock_removal.SelectedValue = "U01-DECO";
                }
                else if ((((Page as PMDC).Distribute.SelectedValue == "PKG")))
                {
                    LOG_Stock_removal.SelectedValue = "U02-PKG";
                }
                //else
                //{
                //    LOG_Stock_removal.SelectedValue = "";
                //}
                LOG_Transportation_group.Text = "0001";
                LOG_LoadingGrp.SelectedValue = "3100";
                LOG_Warehouse_No.Text = "KTD";
                if ((Page as PMDC).Distribute.SelectedValue == "PKG")
                {
                    LOG_Storage_Type.SelectedValue = "";
                    SetEnable(false, LOG_Storage_Type);
                    SetForeColor(Color.Orange, LOG_Storage_Type_L);
                }
                SetEnable(false, LOG_Volume_Unit, LOG_Volume, LOG_Unit_Of_Measure_AUN_A_1, LOG_Unit_Of_Measure_Y_N_1, LOG_Unit_Of_Measure_Bun_B_1
                               , LOG_Unit_Of_Measure_X_D_1, LOG_Stock_removal, LOG_Transportation_group, LOG_LoadingGrp, LOG_Warehouse_No);
                SetForeColor(Color.Orange, LOG_Volume_Unit_L, LOG_Volume_L, LOG_Unit_Of_Measure_AUN_A_L, LOG_Unit_Of_Measure_Y_N_L, LOG_Unit_Of_Measure_Bun_B_L
                                         , LOG_Unit_Of_Measure_X_D_L, LOG_Stock_removal_L, LOG_Transportation_group_L, LOG_LoadingGrp_L, LOG_Warehouse_No_L);
            }
            else if (FORM == "FORM-T009")
            {
                LOG_Volume_Unit.SelectedValue = "L";
                LOG_Volume.Text = "1";
                LOG_Weight_Unit.SelectedValue = "KG";
                LOG_Unit_Of_Measure_AUN_A_1.SelectedValue = "KG";
                LOG_Unit_Of_Measure_Y_N_1.Text = "1000";
                LOG_Unit_Of_Measure_Bun_B_1.SelectedValue = "PC";
                LOG_Volume_Unit.SelectedValue = "L";
                LOG_Weight_Unit.SelectedValue = "KG";
                LOG_LoadingGrp.SelectedValue = "3100";
                LOG_Stock_removal.SelectedValue = "U01-DECO";
                LOG_Transportation_group.Text = "0001";
                LOG_LoadingGrp.SelectedValue = "3100";
                LOG_Warehouse_No.Text = "KTD";
                //LOG_Min_Rem_Shelf_Life.Text = "1";
                //LOG_Period_ind_For_SLED.Text = "D";
                SetEnable(false, LOG_Volume_Unit, LOG_Volume, LOG_Unit_Of_Measure_AUN_A_1, LOG_Unit_Of_Measure_Y_N_1, LOG_Unit_Of_Measure_Bun_B_1
                               , LOG_Unit_Of_Measure_X_D_1, LOG_Stock_removal, LOG_Transportation_group, LOG_LoadingGrp, LOG_Warehouse_No, LOG_Weight_Unit, LOG_Volume_Unit);
                SetForeColor(Color.Orange, LOG_Volume_Unit_L, LOG_Volume_L, LOG_Unit_Of_Measure_AUN_A_L, LOG_Unit_Of_Measure_Y_N_L, LOG_Unit_Of_Measure_Bun_B_L
                                         , LOG_Unit_Of_Measure_X_D_L, LOG_Stock_removal_L, LOG_Transportation_group_L, LOG_LoadingGrp_L, LOG_Warehouse_No_L, LOG_Volume_L
                                         , LOG_Weight_Unit_L);
            }
            else if (FORM == "FORM-T012")
            {

                LOG_Volume_Unit.SelectedValue = "L";
                LOG_Weight_Unit.SelectedValue = "KG";
                LOG_Stock_removal.SelectedValue = "U02-PKG";
                LOG_Transportation_group.Text = "0001";
                LOG_LoadingGrp.SelectedValue = "3100";
                LOG_Warehouse_No.Text = "KTD";
                LOG_Min_Rem_Shelf_Life.Text = "1";
                LOG_Period_ind_For_SLED.Text = "D";

                LOG_Storage_Type.SelectedValue = "";
                SetEnable(false, LOG_Storage_Type);
                SetForeColor(Color.Orange, LOG_Storage_Type_L, LOG_Period_ind_For_SLED_L, LOG_Min_Rem_Shelf_Life_L);

                SetEnable(false, LOG_Storage_Type, LOG_Volume_Unit, LOG_Volume, LOG_Unit_Of_Measure_AUN_A_1, LOG_Unit_Of_Measure_Y_N_1, LOG_Unit_Of_Measure_Bun_B_1
                               , LOG_Unit_Of_Measure_X_D_1, LOG_Stock_removal, LOG_Transportation_group, LOG_LoadingGrp, LOG_Warehouse_No, LOG_Weight_Unit, LOG_Volume_Unit);
                SetForeColor(Color.Orange, LOG_Volume_Unit_L, LOG_Volume_L, LOG_Unit_Of_Measure_AUN_A_L, LOG_Unit_Of_Measure_Y_N_L, LOG_Unit_Of_Measure_Bun_B_L
                                         , LOG_Unit_Of_Measure_X_D_L, LOG_Stock_removal_L, LOG_Transportation_group_L, LOG_LoadingGrp_L, LOG_Warehouse_No_L, LOG_Volume_L, LOG_Weight_Unit_L);
            }
            else if (FORM == "FORM-T006")
            {
                LOG_Weight_Unit.SelectedValue = "KG";
                LOG_Volume_Unit.SelectedValue = "L";
                LOG_Unit_Of_Measure_AUN_A_1.SelectedValue = "KG";
                LOG_Unit_Of_Measure_Y_N_1.Text = "1000";
                LOG_Unit_Of_Measure_Bun_B_1.SelectedValue = "PC";
                LOG_Transportation_group.Text = "0001";
                LOG_LoadingGrp.SelectedValue = "3100";
                LOG_Warehouse_No.Text = "KTD";
                LOG_Unit_Of_Measure_AUN_A_2.SelectedValue = "L";
                LOG_Unit_Of_Measure_Y_N_2.Text = "1000";
                LOG_Unit_Of_Measure_Bun_B_2.SelectedValue = "PC";
                LOG_Unit_Of_Measure_AUN_A_3.SelectedValue = "FCU";
                LOG_Unit_Of_Measure_Bun_B_3.SelectedValue = "PC";
                LOG_Unit_Of_Measure_Y_N_3.Text = "1000";

                LOG_Stock_removal.SelectedValue = "U01-DECO";
                LOG_Cc_phys.Text = "D";

                string t = (Page as PMDC).TabMaterial1.Marketing1.MKT_Pack_Size.Text.ToString();
                if (t == "G5" | t == "L18" | t == "G1" | t == "L3.5" | t == "L2.5" | t == "L1" | t == "L10" | t == "L5")
                {
                    LOG_Storage_Type.SelectedValue = "Blank";
                    LOG_Storage_Section_Ind.SelectedValue = "001";
                    LOG_Stock_placement.SelectedValue = "I03";
                }

                if ((Page as PMDC).TabMaterial1.Marketing1.MKT_Net_Weight.Text != "")
                {
                    double net = 0.0;
                    double.TryParse((Page as PMDC).TabMaterial1.Marketing1.MKT_Net_Weight.Text, out net);
                    LOG_Unit_Of_Measure_X_D_1.Text = (1000 * net).ToString();
                }
                if ((Page as PMDC).TabMaterial1.Marketing1.MKT_Volume.Text != "")
                {
                    double vol = 0.0;
                    double.TryParse((Page as PMDC).TabMaterial1.Marketing1.MKT_Volume.Text, out vol);
                    LOG_Unit_Of_Measure_X_D_2.Text = (1000 * vol).ToString();
                    LOG_Unit_Of_Measure_X_D_3.Text = (1000 * vol).ToString();
                }
                SetEnable(false, LOG_Weight_Unit, LOG_Volume_Unit, LOG_Unit_Of_Measure_AUN_A_1, LOG_Unit_Of_Measure_Bun_B_1
                               , LOG_Transportation_group, LOG_LoadingGrp, LOG_Warehouse_No, LOG_Unit_Of_Measure_X_D_2, LOG_Cc_phys
                               , LOG_Unit_Of_Measure_AUN_A_2, LOG_Unit_Of_Measure_Y_N_2, LOG_Unit_Of_Measure_Bun_B_2, LOG_Stock_removal, LOG_Unit_Of_Measure_Y_N_3, LOG_Unit_Of_Measure_AUN_A_3, LOG_Unit_Of_Measure_Bun_B_3, LOG_Unit_Of_Measure_X_D_3);
                SetForeColor(Color.Orange, LOG_Unit_Of_Measure_X_D_L, LOG_Weight_Unit_L, LOG_Volume_Unit_L, LOG_Unit_Of_Measure_AUN_A_L
                                         , LOG_Unit_Of_Measure_Bun_B_L, LOG_Transportation_group_L, LOG_LoadingGrp_L, LOG_Warehouse_No_L
                                         , LOG_Unit_Of_Measure_Y_N_L, LOG_Stock_removal_L, LOG_Cc_Phys_L);
            }
            else if (FORM == "FORM-T010")
            {
                LOG_Transportation_group.Text = "0001";
                LOG_LoadingGrp.SelectedValue = "3100";
                LOG_Min_Rem_Shelf_Life.Text = "1";
                LOG_Period_ind_For_SLED.Text = "D";
                LOG_Warehouse_No.Text = "KTD";
                LOG_Storage_Type.SelectedValue = "Blank";
                LOG_Stock_removal.SelectedValue = "U02-PKG";
                LOG_Volume_Unit.SelectedValue = "L";
                LOG_Weight_Unit.SelectedValue = "KG";

                SetEnable(false, LOG_Transportation_group, LOG_LoadingGrp, LOG_Min_Rem_Shelf_Life, LOG_Period_ind_For_SLED, LOG_Warehouse_No, LOG_Storage_Type, LOG_Stock_removal, LOG_Volume_Unit, LOG_Weight_Unit);
                SetForeColor(Color.Orange, LOG_Transportation_group_L, LOG_LoadingGrp_L, LOG_Min_Rem_Shelf_Life_L, LOG_Period_ind_For_SLED_L, LOG_Warehouse_No_L, LOG_Storage_Type_L, LOG_Stock_removal_L, LOG_Volume_Unit_L, LOG_Weight_Unit_L);

            }

            //else if (FORM == "FORM-TW-003"||FORM == "FORM-TW-011" || FORM == "FORM-TW-004" || FORM == "FORM-TW-007-1")
            //{
            //    LOG_Gross_Weight.Text = "1";
            //    LOG_Net_Weight.Text = "1";
            //    LOG_Weight_Unit.SelectedValue = "KG";
            //    LOG_Volume_Unit.SelectedValue = "L";
            //    SetForeColor(Color.Orange, LOG_Gross_Weight_L, LOG_Net_Weight_L, LOG_Weight_Unit_L, LOG_Volume_Unit_L);
            //}
            else if (FORM == "FORM-TW-010")
            {
                LOG_Quantity_per_box_L.Text = "Gen. item cat grp";
                LOG_Unit_Of_Measure_X_L.Text = "Denominator";
                LOG_Unit_Of_Measure_Y_L.Text = "Alternative Unit of measure";
                LOG_Unit_Of_Measure_AUN_L.Text = "Numerator";
                LOG_Unit_Of_Measure_Bun_L.Text = "Base Unit of Measure";
                LOG_Transportation_group.Text = "0001";
                LOG_LoadingGrp.Text = "3100";
                LOG_Min_Rem_Shelf_Life.Text = "1";
                LOG_Period_ind_For_SLED.Text = "D";
                LOG_Warehouse_No.Text = "KTD";
                LOG_Storage_Type.SelectedValue = "Blank";
                LOG_Stock_removal.SelectedValue = "U02-PKG";
                //LOG_Gross_Weight.Text = "1";.
                //LOG_Net_Weight.Text = "1";
                LOG_Weight_Unit.SelectedValue = "KG";
                LOG_Volume_Unit.SelectedValue = "L";
                //LOG_Quantity_per_box.Text = "NORM";
                //LOG_Unit_Of_Measure_Y.Text = "KG";
                //LOG_Unit_Of_Measure_Y_1.Text = "L";
                //LOG_Unit_Of_Measure_Y_2.Text = "FCU";
                //LOG_Unit_Of_Measure_Bun.SelectedValue = "PC";
                //LOG_Unit_Of_Measure_Bun_1.SelectedValue = "PC";
                //LOG_Unit_Of_Measure_Bun_2.SelectedValue = "PC";
                SetForeColor(Color.Orange, LOG_Weight_Unit_L, LOG_Transportation_group_L, LOG_Min_Rem_Shelf_Life_L, LOG_Period_ind_For_SLED_L, LOG_Warehouse_No
                    , LOG_LoadingGrp_L, LOG_Warehouse_No_L, LOG_Storage_Type_L, LOG_Stock_removal_L, LOG_Weight_Unit_L, LOG_Volume_Unit_L, LOG_Quantity_per_box_L, LOG_Unit_Of_Measure_Y_L, LOG_Unit_Of_Measure_Bun_L);
                SetEnable(false, LOG_Storage_Type,

                    LOG_Transportation_group, LOG_Min_Rem_Shelf_Life, LOG_Period_ind_For_SLED, LOG_Warehouse_No, LOG_LoadingGrp
                    , LOG_Warehouse_No, LOG_Stock_removal, LOG_Weight_Unit, LOG_Volume_Unit, LOG_Quantity_per_box, LOG_Unit_Of_Measure_Y, LOG_Unit_Of_Measure_Y_1, LOG_Unit_Of_Measure_Y_2, LOG_Unit_Of_Measure_Bun, LOG_Unit_Of_Measure_Bun_1, LOG_Unit_Of_Measure_Bun_2);
            }
            else if (FORM == "FORM-TW-007")
            {
                LOG_Transportation_group.Text = "0001";
                LOG_LoadingGrp.Text = "3100";
                LOG_Warehouse_No.Text = "KTD";
                LOG_Weight_Unit.SelectedValue = "KG";
                LOG_Volume_Unit.SelectedValue = "L";
                LOG_Stock_removal.SelectedValue = "U01-DECO";
                SetForeColor(Color.Orange, LOG_Stock_removal_L, LOG_Transportation_group_L, LOG_LoadingGrp_L, LOG_Warehouse_No_L, LOG_Weight_Unit_L, LOG_Volume_Unit);
                SetEnable(false, LOG_Stock_removal, LOG_Transportation_group, LOG_LoadingGrp, LOG_Warehouse_No, LOG_Volume_Unit, LOG_Weight_Unit);
            }
            else if (FORM == "FORM-T018")
            {
                if ((Page as PMDC).Distribute.SelectedValue.Contains("PKG"))
                {
                    LOG_Stock_removal.SelectedValue = "U02-PKG";
                }
                if ((Page as PMDC).Distribute.SelectedValue.Contains("DECO"))
                {
                    LOG_Stock_removal.SelectedValue = "U01-DECO";
                }
                LOG_Warehouse_No.Text = "KTD";
                SetEnable(false, LOG_Warehouse_No);
                SetForeColor(Color.Orange, LOG_Warehouse_No_L);
            }
            else
            {
                LOG_Unit_Of_Measure_Bun_1.SelectedValue = "PC";
                LOG_Unit_Of_Measure_Bun_2.SelectedValue = "PC";
            }
        }
        #endregion

        #region 方法 SetToolTip(设置控件 ToolTip)
        public void SetToolTip()
        {
            switch (Category)
            {
                case "FINI":
                case "TRADE":
                    LOG_Trans_Grp.ToolTip = "运输组(默认为0001-On pallets)";
                    LOG_LoadingGrp.ToolTip = "装载组";
                    LOG_Coefficient_Of_Logistic.ToolTip = "储运比重规则";
                    LOG_Gross_Weight.ToolTip = "毛重";
                    LOG_Net_Weight.ToolTip = "净重";
                    LOG_Volume.ToolTip = "体积";
                    LOG_Storage_Location.ToolTip = "需要扩展的仓位";

                    if (FORM == "FORM-001")
                    {
                        LOG_Plant.ToolTip = "需要扩展的工厂(仅D-Plant)";
                        LOG_Weight_Unit.ToolTip = "重量单位 (默认为KG)";
                        LOG_Net_Weight.ToolTip = "净重 (密度*体积)";
                        LOG_Volume_Unit.ToolTip = "体积单位 (默认为L)";
                    }

                    if (FORM == "FORM-064" || FORM == "FORM-074" || FORM == "FORM-015")
                    {
                        LOG_Weight_Unit.ToolTip = "重量单位 (默认为KG)";
                        LOG_Volume_Unit.ToolTip = "体积单位 (默认为L)";
                    }

                    if (FORM == "FORM-014")
                    {
                        LOG_Quantity_per_box.ToolTip = "每箱数量";
                        LOG_Gross_Weight.ToolTip = "最小发货单位毛重（KG），不超过三位小数";
                        LOG_Net_Weight.ToolTip = "最小发货单位净重（KG），不超过三位小数";
                        LOG_Volume.ToolTip = "最小发货单位体积（M3），不超过三位小数";
                        LOG_Volume_Unit.ToolTip = "最小发货单位体积单位（M3）";
                        LOG_Weight_Unit.ToolTip = "重量单位，默认为KG";
                        LOG_Trans_Grp.ToolTip = "运输组，默认为0001：On pallets";
                        LOG_LoadingGrp.ToolTip = "装载组，默认为3000";
                        LOG_Storage_Location.ToolTip = "需要扩展的仓位";
                    }
                    if (FORM.IndexOf("T") != -1)
                    {
                        LOG_Weight_Unit.ToolTip = "重量單位";
                        LOG_Gross_Weight.ToolTip = "毛重 不超過3為小數";
                        LOG_Net_Weight.ToolTip = "淨重 不超過3為小數";
                        LOG_Volume_Unit.ToolTip = "體積單位  ";
                        LOG_Volume.ToolTip = "體積 不超過3為小數 ";
                        LOG_Unit_Of_Measure_Y_N_1.ToolTip = "基本計量單位轉換分子 ";
                        LOG_Transportation_group.ToolTip = "運輸組 ";
                        LOG_LoadingGrp.ToolTip = "裝載組 ";
                        LOG_Warehouse_No.ToolTip = "倉庫號/混合倉庫";
                        LOG_Storage_Type.ToolTip = "倉儲類型";
                        LOG_Stock_removal.ToolTip = "庫存齣庫指示符的存儲類型";
                        LOG_Stock_placement.ToolTip = "庫存入庫的存儲類型指示符";
                        LOG_Bulk_storage.ToolTip = "散裝庫存標識符 僅當Stock placement爲I02時必須填寫02,其他選填";
                        LOG_Storage_Section_Ind.ToolTip = "倉儲區標識 僅當Stock placement爲I01時填寫";
                        LOG_LE_quantity1.ToolTip = "裝載設備數量1";
                        LOG_LE_quantity2.ToolTip = "裝載設備數量2";
                        LOG_LE_quantity3.ToolTip = "裝載設備數量3";
                        LOG_SUT1.ToolTip = "第一個存儲單位類型";
                        LOG_SUT2.ToolTip = "第二個存儲單位類型";
                        LOG_SUT3.ToolTip = "第三個存儲單位類型";
                        LOG_Storage_Bin.ToolTip = "倉位";
                        LOG_Maximum_bin_quantity.ToolTip = "最大倉位數量＝LE Quantity*2";
                        LOG_Minimum_bin_quantity.ToolTip = "最小倉位數量＝LE Quantity";
                        LOG_Control_quantity.ToolTip = "控製數量＝LE Quantity-1";
                        LOG_Replenishment_qty.ToolTip = "補充數量＝LE Quantity";

                        LOG_Total_Shelf_life.ToolTip = "總貨架壽命 僅PKG必填";
                        LOG_Period_ind_For_SLED.ToolTip = "貨架壽命到期的期間標識 僅PKG需要";
                        LOG_Cc_phys.ToolTip = "週期盤點的盤點標識";
                        LOG_Cc_Fixed.ToolTip = "週期標識被固定";
                        LOG_Total_Shelf_life.ToolTip = "總貨架壽命";
                        LOG_Min_Rem_Shelf_Life.ToolTip = "最短剩餘貨架壽命";
                        LOG_Period_ind_For_SLED.ToolTip = "貨架壽命到期的期間標識";
                        LOG_Capacity_Usage.ToolTip = "容量使用";
                        if (FORM == "FORM-TW-010")
                        {

                            LOG_Capacity_Usage.ToolTip = "容量使用，Capacity/LE Quantity,僅PKG部分物料使用";
                        }
                    }
                    if (FORM == "FORM-T001")
                    {
                        LOG_Gross_Weight.ToolTip = "毛重 不超過3為小數";
                        LOG_Net_Weight.ToolTip = "淨重 不超過3為小數";
                        LOG_Volume_Unit.ToolTip = "體積單位 默認爲L";
                        LOG_Volume.ToolTip = "體積 默認爲1";
                        LOG_Unit_Of_Measure_Y_N_1.ToolTip = "基本計量單位轉換分子 默認爲1000";
                        LOG_Transportation_group.ToolTip = "運輸組 默認爲0001";
                        LOG_LoadingGrp.ToolTip = "裝載組 默認爲3100";
                        LOG_Warehouse_No.ToolTip = "倉庫號/混合倉庫";
                        LOG_Storage_Type.ToolTip = "倉儲類型";
                        LOG_Stock_removal.ToolTip = "庫存齣庫指示符的存儲類型";
                        LOG_Stock_placement.ToolTip = "庫存入庫的存儲類型指示符";
                        LOG_Bulk_storage.ToolTip = "散裝庫存標識符 僅當Stock placement爲I02時必須填寫02,其他選填";
                        LOG_Storage_Section_Ind.ToolTip = "倉儲區標識 僅當Stock placement爲I01時填寫";
                        LOG_LE_quantity1.ToolTip = "裝載設備數量1";
                        LOG_LE_quantity2.ToolTip = "裝載設備數量2";
                        LOG_LE_quantity3.ToolTip = "裝載設備數量3";
                        LOG_SUT1.ToolTip = "第一個存儲單位類型";
                        LOG_SUT2.ToolTip = "第二個存儲單位類型";
                        LOG_SUT3.ToolTip = "第三個存儲單位類型";
                        LOG_Storage_Bin.ToolTip = "倉位";
                        LOG_Maximum_bin_quantity.ToolTip = "最大倉位數量＝LE Quantity*2";
                        LOG_Minimum_bin_quantity.ToolTip = "最小倉位數量＝LE Quantity";
                        LOG_Control_quantity.ToolTip = "控製數量＝LE Quantity-1";
                        LOG_Replenishment_qty.ToolTip = "補充數量＝LE Quantity";
                    }

                    if (FORM == "FORM-T009" || FORM == "FORM-T012")
                    {
                        LOG_Gross_Weight.ToolTip = "毛重 不超過3為小數";
                        LOG_Net_Weight.ToolTip = "淨重 不超過3為小數";
                        LOG_Volume_Unit.ToolTip = "體積單位  默認爲L ";
                        LOG_Volume.ToolTip = "體積 默認爲1";
                        LOG_Unit_Of_Measure_Y_N_1.ToolTip = "基本計量單位轉換分子 默認爲1000";
                        LOG_Transportation_group.ToolTip = "運輸組 默認爲0001";
                        LOG_LoadingGrp.ToolTip = "裝載組 默認爲3100";
                        LOG_Warehouse_No.ToolTip = "倉庫號/混合倉庫";
                        LOG_Storage_Type.ToolTip = "倉儲類型";
                        LOG_Stock_removal.ToolTip = "庫存齣庫指示符的存儲類型";
                        LOG_Stock_placement.ToolTip = "庫存入庫的存儲類型指示符";
                        LOG_Bulk_storage.ToolTip = "散裝庫存標識符 僅當Stock placement爲I02時必須填寫02,其他選填";
                        LOG_Storage_Section_Ind.ToolTip = "倉儲區標識 僅當Stock placement爲I01時填寫";
                        LOG_LE_quantity1.ToolTip = "裝載設備數量1";
                        LOG_LE_quantity2.ToolTip = "裝載設備數量2";
                        LOG_LE_quantity3.ToolTip = "裝載設備數量3";
                        LOG_SUT1.ToolTip = "第一個存儲單位類型";
                        LOG_SUT2.ToolTip = "第二個存儲單位類型";
                        LOG_SUT3.ToolTip = "第三個存儲單位類型";
                        LOG_Storage_Bin.ToolTip = "倉位";
                        LOG_Maximum_bin_quantity.ToolTip = "最大倉位數量＝LE Quantity*2";
                        LOG_Minimum_bin_quantity.ToolTip = "最小倉位數量＝LE Quantity";
                        LOG_Control_quantity.ToolTip = "控製數量＝LE Quantity-1";
                        LOG_Replenishment_qty.ToolTip = "補充數量＝LE Quantity";
                        //LOG_Min_Rem_Shelf_Life.ToolTip = "最短剩餘貨架壽命 默認爲1，僅PKG需要";
                        LOG_Total_Shelf_life.ToolTip = "總貨架壽命 僅PKG必填";
                        //LOG_Period_ind_For_SLED.ToolTip = "貨架壽命到期的期間標識 默認爲D，僅PKG需要";
                        LOG_Weight_Unit.ToolTip = "重量單位 默認爲KG";
                        LOG_Volume_Unit.ToolTip = "體積單位 默認爲L";
                        LOG_Capacity_Usage.ToolTip = "容量使用,Capacity/LE Quantity,僅PKG部分物料使用";
                    }
                    if (FORM == "FORM-T006")
                    {
                        LOG_Volume_Unit.ToolTip = "體積單位 默認爲L";
                        LOG_Volume_Unit.ToolTip = "體積單位 默認爲L";
                        LOG_Unit_Of_Measure_Y_N_1.ToolTip = "基本計量單位轉換分子 默認爲1000";
                        LOG_Transportation_group.ToolTip = "運輸組 默認爲0001";
                        LOG_LoadingGrp.ToolTip = "裝載組 默認爲3100";
                        LOG_Warehouse_No.ToolTip = "倉庫號/混合倉庫";
                        LOG_Storage_Type.ToolTip = "倉儲類型 PKG: 全部為空；DECO: 空或者P01";
                        LOG_Stock_removal.ToolTip = "庫存齣庫指示符的存儲類型";
                        LOG_Stock_placement.ToolTip = "庫存入庫的存儲類型指示符";
                        LOG_Bulk_storage.ToolTip = "散裝庫存標識符 僅當Stock placement爲I02時必須填寫02,其他選填";
                        LOG_Storage_Section_Ind.ToolTip = "倉儲區標識 僅當Stock placement爲I01時填寫";
                        LOG_LE_quantity1.ToolTip = "裝載設備數量1";
                        LOG_LE_quantity2.ToolTip = "裝載設備數量2";
                        LOG_LE_quantity3.ToolTip = "裝載設備數量3";
                        LOG_SUT1.ToolTip = "第一個存儲單位類型";
                        LOG_SUT2.ToolTip = "第二個存儲單位類型";
                        LOG_SUT3.ToolTip = "第三個存儲單位類型";
                        LOG_Storage_Bin.ToolTip = "倉位";
                        LOG_Maximum_bin_quantity.ToolTip = "最大倉位數量＝LE Quantity*2";
                        LOG_Minimum_bin_quantity.ToolTip = "最小倉位數量＝LE Quantity";
                        LOG_Control_quantity.ToolTip = "控製數量＝LE Quantity-1";
                        LOG_Replenishment_qty.ToolTip = "補充數量＝LE Quantity";
                        LOG_Cc_phys.ToolTip = "周期盤點的盤點標識";
                        LOG_Cc_Fixed.ToolTip = "周期 標識被固定";
                        LOG_Unit_Of_Measure_X_D_2.ToolTip = "轉換爲基本計量單位的分母 L轉換值，即Volume *1000";
                        LOG_Unit_Of_Measure_Y_N_2.ToolTip = "基本計量單位轉換分子 默認為1000";
                    }
                    if (FORM == "FORM-T010")
                    {
                        LOG_Transportation_group.ToolTip = "運輸組 默認爲0001";
                        LOG_LoadingGrp.ToolTip = "裝載組 默認爲3100";
                        LOG_Cc_phys.ToolTip = "周期盤點的盤點標識 必填";
                        LOG_Cc_Fixed.ToolTip = "周期 標識被固定";
                        LOG_Min_Rem_Shelf_Life.ToolTip = "最短剩餘貨架壽命 默認爲1";
                        LOG_Total_Shelf_life.ToolTip = "總貨架壽命 必填";
                        LOG_Period_ind_For_SLED.ToolTip = "貨架壽命到期的期間標識 默認爲D";
                        LOG_Warehouse_No.ToolTip = "倉庫號/混合倉庫";
                        LOG_Storage_Type.ToolTip = "倉儲類型 PKG: 全部為空；DECO: 空或者P01";
                        LOG_Capacity_Usage.ToolTip = "容量使用 Capacity/LE Quantity,僅PKG部分物料使用";
                        LOG_Stock_removal.ToolTip = "庫存齣庫指示符的存儲類型";
                        LOG_Stock_placement.ToolTip = "庫存入庫的存儲類型指示符";
                        LOG_LE_quantity1.ToolTip = "裝載設備數量1";
                        LOG_LE_quantity2.ToolTip = "裝載設備數量2";
                        LOG_LE_quantity3.ToolTip = "裝載設備數量3";
                        LOG_SUT1.ToolTip = "第一個存儲單位類型";
                        LOG_SUT2.ToolTip = "第二個存儲單位類型";
                        LOG_SUT3.ToolTip = "第三個存儲單位類型";
                    }
                    if (FORM == "FORM-T003")
                    {
                        LOG_Total_Shelf_life.ToolTip = "總貨架壽命";
                    }
                    if (FORM == "FORM-T018")
                    {
                        LOG_Total_Shelf_life.ToolTip = "總貨架壽命 必填";
                        LOG_Warehouse_No.ToolTip = "倉庫號/混合倉庫";
                        LOG_Storage_Type.ToolTip = "倉儲類型 PKG: 全部為空；DECO: 空或者P01";
                        LOG_Capacity_Usage.ToolTip = "容量使用 Capacity/LE Quantity,僅PKG部分物料使用";
                        LOG_Stock_removal.ToolTip = "庫存齣庫指示符的存儲類型";
                        LOG_Stock_placement.ToolTip = "庫存入庫的存儲類型指示符";
                        LOG_Storage_Section_Ind.ToolTip = "倉儲區標識 僅當Stock placement爲I01時填寫";
                        LOG_Bulk_storage.ToolTip = "散裝庫存標識符 僅當Stock placement爲I02時必須填寫02,其他選填";
                        LOG_LE_quantity1.ToolTip = "裝載設備數量1";
                        LOG_LE_quantity2.ToolTip = "裝載設備數量2";
                        LOG_LE_quantity3.ToolTip = "裝載設備數量3";
                        LOG_SUT1.ToolTip = "第一個存儲單位類型";
                        LOG_SUT2.ToolTip = "第二個存儲單位類型";
                        LOG_SUT3.ToolTip = "第三個存儲單位類型";
                        LOG_Storage_Bin.ToolTip = "倉位";
                        LOG_Maximum_bin_quantity.ToolTip = "最大倉位數量＝LE Quantity*2";
                        LOG_Minimum_bin_quantity.ToolTip = "最小倉位數量＝LE Quantity";
                        LOG_Control_quantity.ToolTip = "控製數量＝LE Quantity-1";
                        LOG_Replenishment_qty.ToolTip = "補充數量＝LE Quantity";
                    }
                    //if (FORM == "FORM-TW-003")
                    //{
                    //    LOG_Gross_Weight.ToolTip = "毛重 ";
                    //    LOG_Weight_Unit.ToolTip = "重量單位 ";
                    //    LOG_Volume.ToolTip = "體積(1/WPL)";
                    //    LOG_Volume_Unit.ToolTip = "體積單位(默認為L)";
                    //    LOG_Total_Shelf_life.ToolTip = "總貨架壽命";
                    //    LOG_Net_Weight.ToolTip = "淨重(默認為1)";
                    //}
                    break;
            }
        }
        #endregion

        #region 方法 DataValidation(数据验证)
        public List<string> DataValidation(mdc_Material mt, string Sheet)
        {
            //如果当前 Tabs 是隐藏的情况，退出
            if (!(IsUsed && (Action == "C" || Action == "E")))
            {
                return new List<string>();
            }

            List<Regular> regs = new List<Regular>();
            switch (Category)
            {
                case "SEFI":
                    break;
                case "RAW":
                    break;

                case "PACK":
                    break;

                case "FINI":
                    if (this.TaskAPI.Process == "HK ADVE Code Application")
                    {
                        if ((Page as PMDC).rd_HK_ADVE_Biz_Type.SelectedValue == "0" && FORM == "FORM-065-1")
                        {
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Coefficient_Of_Logistic_L, mt.LOG_Coefficient_Of_Logistic, Sheet + "Coefficient of logistic 必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_LoadingGrp_L, mt.LOG_LoadingGrp, Sheet + "LoadingGrp 必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Storage_Location_L, mt.LOG_Storage_Location, Sheet + "Store Location 必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Plant_L, mt.LOG_Plant, Sheet + "Plant 必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Gross_Weight_L, mt.LOG_Gross_Weight, Sheet + "Gross Weight 必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Net_Weight_L, mt.LOG_Net_Weight, Sheet + "Net Weight 必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Volume_L, mt.LOG_Volume, Sheet + "Volume 必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Unit_Of_Measure_X_L, mt.LOG_Unit_Of_Measure_X, Sheet + "Unit of measure X 必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Unit_Of_Measure_AUN_L, mt.LOG_Unit_Of_Measure_AUN, Sheet + "Unit of measure AUN 必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Unit_Of_Measure_Y_L, mt.LOG_Unit_Of_Measure_Y, Sheet + "Unit of measure Y 必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Unit_Of_Measure_Bun_L, mt.LOG_Unit_Of_Measure_Bun, Sheet + "Unit of measure BUN 必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Quantity_per_box_L, mt.LOG_Quantity_per_box, Sheet + "Quantity per Box 必填");
                        }

                        if ((Page as PMDC).rd_HK_ADVE_Biz_Type.SelectedValue == "1" && FORM == "FORM-065-2")
                        {
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Coefficient_Of_Logistic_L, mt.LOG_Coefficient_Of_Logistic, Sheet + "Coefficient of logistic 必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_LoadingGrp_L, mt.LOG_LoadingGrp, Sheet + "LoadingGrp 必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Storage_Location_L, mt.LOG_Storage_Location, Sheet + "Store Location 必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Plant_L, mt.LOG_Plant, Sheet + "Plant 必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Gross_Weight_L, mt.LOG_Gross_Weight, Sheet + "Gross Weight 必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Net_Weight_L, mt.LOG_Net_Weight, Sheet + "Net Weight 必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Volume_L, mt.LOG_Volume, Sheet + "Volume 必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Unit_Of_Measure_X_L, mt.LOG_Unit_Of_Measure_X, Sheet + "Unit of measure X 必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Unit_Of_Measure_AUN_L, mt.LOG_Unit_Of_Measure_AUN, Sheet + "Unit of measure AUN 必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Unit_Of_Measure_Y_L, mt.LOG_Unit_Of_Measure_Y, Sheet + "Unit of measure Y 必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Unit_Of_Measure_Bun_L, mt.LOG_Unit_Of_Measure_Bun, Sheet + "Unit of measure BUN 必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Quantity_per_box_L, mt.LOG_Quantity_per_box, Sheet + "Quantity per Box 必填");
                        }

                        return Validation(regs);
                    }

                    if (TaskAPI.Process == "HK-MTO Base Code Application" && FORM == "FORM-067")
                    {
                        //akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Coefficient_Of_Logistic_L, mt.LOG_Coefficient_Of_Logistic, Sheet + "Coefficient of logistic 必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_LoadingGrp_L, mt.LOG_LoadingGrp, Sheet + "LoadingGrp 必填");
                        //akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Volume_L, mt.LOG_Volume, Sheet + "Volume 必填");
                        return Validation(regs);
                    }
                    if (TaskAPI.Process == "TW ADVE Code Application" && FORM == "FORM-T001")
                    {
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Stock_placement_L, mt.LOG_Stock_placement, Sheet + "Stock placement 爲必填");
                        if ((Page as PMDC).Distribute.SelectedValue == "DECO")
                        {
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Storage_Type_L, mt.LOG_Storage_Type, Sheet + "Storage Type 爲必填");
                        }
                        return Validation(regs);
                    }
                    if (FORM == "FORM-T012")
                    {
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Stock_placement_L, mt.LOG_Stock_placement, Sheet + "Stock placement 必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Total_Shelf_life_L, mt.LOG_Total_Shelf_life, Sheet + "Total Shelf life 必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Storage_Section_Ind_L, mt.LOG_Storage_Section_Ind, Sheet + "Storage Section Ind 必填");
                        return Validation(regs);
                    }
                    if (TaskAPI.Process == "TW Trade Code Application-DECO" && FORM == "FORM-T009")
                    {
                        //akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Stock_removal_L, mt.LOG_Stock_removal, Sheet + "Stock removal 爲必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Stock_placement_L, mt.LOG_Stock_placement, Sheet + "Stock placement 爲必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Storage_Type_L, mt.LOG_Storage_Type, Sheet + "Storage Type 爲必填");
                        return Validation(regs);
                    }
                    if (TaskAPI.Process == "TW MTO Application-DECO" && FORM == "FORM-T006")
                    {
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Cc_Phys_L, mt.LOG_Cc_Phys, Sheet + "CC phys. inv. ind. 爲必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Storage_Type_L, mt.LOG_Storage_Type, Sheet + "Storage Type 爲必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Stock_placement_L, mt.LOG_Stock_placement, Sheet + "Stock placement 爲必填");
                        //akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Stock_removal_L, mt.LOG_Stock_removal, Sheet + "Stock removal 爲必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Storage_Bin_L, mt.LOG_Storage_Bin, Sheet + "Storage Bin 爲必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Maximum_bin_quantity_L, mt.LOG_Maximum_bin_quantity, Sheet + "Maximum bin quantity 爲必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Control_quantity_L, mt.LOG_Control_quantity, Sheet + "Control quantity 爲必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Minimum_bin_quantity_L, mt.LOG_Minimum_bin_quantity, Sheet + "Minimum bin quantity 爲必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Replenishment_qty_L, mt.LOG_Replenishment_qty, Sheet + "Replenishment qty 爲必填");

                    }
                    if (TaskAPI.Process == "TW MTO Application-PKG" && FORM == "FORM-T010")
                    {
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Cc_Phys_L, mt.LOG_Cc_Phys, Sheet + "CC phys. inv. ind. 爲必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Total_Shelf_life_L, mt.LOG_Total_Shelf_life, Sheet + "Total Shelf life 必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Stock_placement_L, mt.LOG_Stock_placement, Sheet + "Stock placement 爲必填");
                    }
                    if (TaskAPI.Process == "TW Raw Code Application" && FORM == "FORM-T018")
                    {
                        //if ((Page as PMDC).Distribute.SelectedValue == "DECO")
                        //{
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Storage_Type_L, mt.LOG_Storage_Type, Sheet + "Storage Type 爲必填");
                        //}
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Stock_removal_L, mt.LOG_Stock_removal, Sheet + "Stock removal 爲必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Stock_placement_L, mt.LOG_Stock_placement, Sheet + "Stock placement 爲必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Storage_Section_Ind_L, mt.LOG_Storage_Section_Ind, Sheet + "Storage Section Ind 必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Storage_Bin_L, mt.LOG_Storage_Bin, Sheet + "Storage Bin 爲必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Maximum_bin_quantity_L, mt.LOG_Maximum_bin_quantity, Sheet + "Maximum bin quantity 爲必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Control_quantity_L, mt.LOG_Control_quantity, Sheet + "Control quantity 爲必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Minimum_bin_quantity_L, mt.LOG_Minimum_bin_quantity, Sheet + "Minimum bin quantity 爲必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Replenishment_qty_L, mt.LOG_Replenishment_qty, Sheet + "Replenishment qty 爲必填");
                    }
                    if (TaskAPI.Process == "ADVE Code Application" && FORM == "FORM-014")
                    {
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Gross_Weight_L, mt.LOG_Gross_Weight, Sheet + "Gross Weight 必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Net_Weight_L, mt.LOG_Net_Weight, Sheet + "Net Weight 必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Volume_L, mt.LOG_Volume, Sheet + "Volume 必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Quantity_per_box_L, mt.LOG_Quantity_per_box, Sheet + "Quantity per box 必填");
                        return Validation(regs);

                    }

                    //if (FORM == "FORM-TW-011" || FORM == "FORM-TW-007-1" || FORM == "FORM-TW-004" || FORM == "FORM-TW-003")
                    //{
                    //    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Volume_L, mt.LOG_Volume, Sheet + "Volume 必填");
                    //    return Validation(regs);
                    //}
                    if (FORM == "FORM-TW-010" || FORM == "FORM-TW-007")
                    {
                        if (!string.IsNullOrEmpty(mt.LOG_Gross_Weight))
                        {
                            regs.Add(new Regular(RegularExp.Digit3, mt.LOG_Gross_Weight, Sheet + "Gross Weight 不超過三位小數"));
                        }
                        else
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Gross_Weight_L, mt.LOG_Gross_Weight, Sheet + "Gross Weight 必填不超過三位小數");
                        if (!string.IsNullOrEmpty(mt.LOG_Net_Weight))
                        {
                            regs.Add(new Regular(RegularExp.Digit3, mt.LOG_Net_Weight, Sheet + "Net Weight不超過三位小數"));
                        }
                        else
                            akzo_RegularCheck(ref regs, RegularExp.Digit3, LOG_Net_Weight_L, mt.LOG_Net_Weight, Sheet + "Net Weight必填不超過三位小數");
                        if (!string.IsNullOrEmpty(mt.LOG_Volume))
                        {
                            regs.Add(new Regular(RegularExp.Digit3, mt.LOG_Volume, Sheet + "Volume不超過三位小數"));
                        }
                        else
                            akzo_RegularCheck(ref regs, RegularExp.Digit3, LOG_Volume_L, mt.LOG_Volume, Sheet + "Net Weight必填不超過三位小數");


                        //akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Volume_L, mt.LOG_Volume, Sheet + "Volume 必填");
                        //akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Gross_Weight_L, mt.LOG_Gross_Weight, Sheet + "Gross Weight 必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Cc_Phys_L, mt.LOG_Cc_Phys, Sheet + "CC phys. inv. ind. 必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Total_Shelf_life_L, mt.LOG_Total_Shelf_life, Sheet + "Total Shelf life 必填");
                        if (FORM == "FORM-TW-010")
                        {
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Unit_Of_Measure_X_L, (mt.LOG_Unit_Of_Measure_X + "").Trim(), Sheet + "Denominator 第1行 必填");
                            akzo_RegularCheck(ref regs, RegularExp.Integer, LOG_Unit_Of_Measure_AUN_L, (mt.LOG_Unit_Of_Measure_AUN + "").Trim(), Sheet + "Numerator  第1行 必填为整数");
                        }
                        //if (mt.PLA_Plant.Contains("D"))
                        //{
                        //    regs.Add(new Regular(RegularExp.NotEmpty, mt.LOG_Storage_Type, Sheet + "Storage Type 必填"));
                        //    regs.Add(new Regular(RegularExp.NotEmpty, mt.LOG_Stock_placement, Sheet + "Stock placement 必填"));
                        //    if (mt.LOG_Stock_placement == "I01")
                        //    {
                        //        regs.Add(new Regular(RegularExp.NotEmpty, mt.LOG_Storage_Section_Ind, Sheet + "Storag Section Ind 必填"));
                        //    }
                        //}
                        if (TaskAPI.Process != "TW NPL Application-DECO")
                        {
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Storage_Section_Ind_L, mt.LOG_Storage_Section_Ind, Sheet + "Storage Section Ind 必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Stock_placement_L, mt.LOG_Stock_placement, Sheet + "Stock placement 必填");
                        }
                        //regs.Add(new Regular(RegularExp.NotEmpty, mt.LOG_Stock_placement, Sheet + "Stock placement 必填")); Stock Removal

                        if (mt.LOG_Stock_placement == "I01")
                        {
                            if (mt.LOG_Storage_Section_Ind == "001")
                            {
                                regs.Add(new Regular(RegularExp.NotEmpty, "", Sheet + "当 Stock placement是I01,storage section ind 不可以是 001"));
                            }
                        }
                        if (mt.LOG_Storage_Type == "P01")
                        {
                            if (!string.IsNullOrEmpty(mt.LOG_Minimum_bin_quantity) || !string.IsNullOrEmpty(mt.LOG_Replenishment_qty) || !string.IsNullOrEmpty(mt.LOG_Storage_Bin) || !string.IsNullOrEmpty(mt.LOG_Maximum_bin_quantity) || !string.IsNullOrEmpty(mt.LOG_Control_quantity))
                            {
                                regs.Add(new Regular(RegularExp.Integer, mt.LOG_Minimum_bin_quantity, Sheet + "Minimum bin quantity 為數字必填"));
                                regs.Add(new Regular(RegularExp.Integer, mt.LOG_Replenishment_qty, Sheet + "Replenishment qty 為數字必填"));
                                regs.Add(new Regular(RegularExp.NotEmpty, mt.LOG_Storage_Bin, Sheet + "Storage Bin 必填"));
                                regs.Add(new Regular(RegularExp.Integer, mt.LOG_Maximum_bin_quantity, Sheet + "Maximum bin quantity 為數字必填"));
                                regs.Add(new Regular(RegularExp.Integer, mt.LOG_Control_quantity, Sheet + "Control quantity 為數字必填"));
                            }
                            //akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Minimum_bin_quantity_L, mt.LOG_Minimum_bin_quantity, Sheet + "Minimum bin quantity 必填");
                            //akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Replenishment_qty_L, mt.LOG_Replenishment_qty, Sheet + "Replenishment qty 必填");
                            //akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Storage_Bin_L, mt.LOG_Storage_Bin, Sheet + "Storage Bin 必填");
                            //akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Maximum_bin_quantity_L, mt.LOG_Maximum_bin_quantity, Sheet + " Maximum bin quantity 必填");
                            //akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Control_quantity_L, mt.LOG_Control_quantity, Sheet + " Control quantity 必填");
                        }
                        return Validation(regs);
                    }

                    if (TaskAPI.Process == "Trade Code Application")
                    {
                        if (!string.IsNullOrEmpty(LOG_Gross_Weight.Text.Trim()))
                        {
                            try
                            {
                                decimal a = Convert.ToDecimal(LOG_Gross_Weight.Text.Trim());
                            }
                            catch (Exception)
                            {
                                regs.Add(new Regular(RegularExp.NotEmpty, "".Trim(), Sheet + " Gross_Weight 必须为数字！"));

                            }
                            regs.Add(new Regular(RegularExp.Digit3, mt.LOG_Gross_Weight, Sheet + " Gross_Weight 不超过三位小数"));
                        }
                        if (!string.IsNullOrEmpty(LOG_Volume.Text.Trim()))
                        {
                            try
                            {
                                decimal b = Convert.ToDecimal(LOG_Volume.Text.Trim());
                            }
                            catch (Exception)
                            {
                                regs.Add(new Regular(RegularExp.NotEmpty, "".Trim(), Sheet + " Volume 必须为数字！"));

                            }
                            regs.Add(new Regular(RegularExp.Digit3, mt.LOG_Volume, Sheet + "Volume 不超过三位小数"));
                        }
                        if (!string.IsNullOrEmpty(LOG_Net_Weight.Text.Trim()))
                        {
                            try
                            {
                                decimal c = Convert.ToDecimal(LOG_Net_Weight.Text.Trim());
                            }
                            catch (Exception)
                            {
                                regs.Add(new Regular(RegularExp.NotEmpty, "".Trim(), Sheet + "  Net_Weight 必须为数字！"));

                            }
                            regs.Add(new Regular(RegularExp.Digit3, mt.LOG_Net_Weight, Sheet + "Net_Weight 不超过三位小数"));
                        }
                        if (!string.IsNullOrEmpty(LOG_Unit_Of_Measure_X_1.Text.Trim()))
                        {
                            try
                            {
                                decimal b = Convert.ToDecimal(LOG_Unit_Of_Measure_X_1.Text.Trim());
                            }
                            catch (Exception)
                            {
                                regs.Add(new Regular(RegularExp.NotEmpty, "".Trim(), Sheet + "  LOG_Unit_Of_Measure_X 必须为数字！"));

                            }
                        }
                        if (!string.IsNullOrEmpty(LOG_Unit_Of_Measure_X.Text.Trim()))
                        {
                            try
                            {
                                decimal a = Convert.ToDecimal(LOG_Unit_Of_Measure_X.Text.Trim());
                                //decimal c = Convert.ToDecimal(LOG_Unit_Of_Measure_X_2.Text.Trim());
                                //decimal b = Convert.ToDecimal(LOG_Unit_Of_Measure_X_1.Text.Trim());
                            }
                            catch (Exception)
                            {
                                regs.Add(new Regular(RegularExp.NotEmpty, "".Trim(), Sheet + "  LOG_Unit_Of_Measure_X 必须为数字！"));

                            }
                        }
                        if (!string.IsNullOrEmpty(LOG_Unit_Of_Measure_X_2.Text.Trim()))
                        {
                            try
                            {
                                //decimal a = Convert.ToDecimal(LOG_Unit_Of_Measure_X.Text.Trim());
                                decimal c = Convert.ToDecimal(LOG_Unit_Of_Measure_X_2.Text.Trim());
                                //decimal b = Convert.ToDecimal(LOG_Unit_Of_Measure_X_1.Text.Trim());
                            }
                            catch (Exception)
                            {
                                regs.Add(new Regular(RegularExp.NotEmpty, "".Trim(), Sheet + "  LOG_Unit_Of_Measure_X 必须为数字！"));

                            }
                        }
                        if (!string.IsNullOrEmpty(LOG_Unit_Of_Measure_Y_1.Text.Trim()))
                        {
                            try
                            {
                                //decimal a = Convert.ToDecimal(LOG_Unit_Of_Measure_Y.Text.Trim());
                                decimal b = Convert.ToDecimal(LOG_Unit_Of_Measure_Y_1.Text.Trim());
                                //decimal c = Convert.ToDecimal  (LOG_Unit_Of_Measure_Y_2.Text.Trim());
                            }
                            catch (Exception)
                            {
                                regs.Add(new Regular(RegularExp.NotEmpty, "".Trim(), Sheet + "  LOG_Unit_Of_Measure_Y 必须为数字！"));

                            }
                        }
                        if (!string.IsNullOrEmpty(LOG_Unit_Of_Measure_Y.Text.Trim()))
                        {
                            try
                            {
                                decimal a = Convert.ToDecimal(LOG_Unit_Of_Measure_Y.Text.Trim());
                                //decimal b = Convert.ToDecimal(LOG_Unit_Of_Measure_Y_1.Text.Trim());
                                //decimal c = Convert.ToDecimal  (LOG_Unit_Of_Measure_Y_2.Text.Trim());
                            }
                            catch (Exception)
                            {
                                regs.Add(new Regular(RegularExp.NotEmpty, "".Trim(), Sheet + "  LOG_Unit_Of_Measure_Y 必须为数字！"));

                            }
                        }
                        if (!string.IsNullOrEmpty(LOG_Unit_Of_Measure_Y_2.Text.Trim()))
                        {
                            try
                            {
                                decimal c = Convert.ToDecimal(LOG_Unit_Of_Measure_Y_2.Text.Trim());
                            }
                            catch (Exception)
                            {
                                regs.Add(new Regular(RegularExp.NotEmpty, "".Trim(), Sheet + "  LOG_Unit_Of_Measure_Y 必须为数字！"));

                            }
                        }
                        //akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_LoadingGrp_L, mt.LOG_LoadingGrp, Sheet + "LoadingGrp 必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Storage_Location_L, mt.LOG_Storage_Location, Sheet + "Store Location 必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Plant_L, mt.LOG_Plant, Sheet + "Plant 必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Gross_Weight_L, (mt.LOG_Gross_Weight + "").Trim(), Sheet + "Gross Weight 必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Net_Weight_L, (mt.LOG_Net_Weight + "").Trim(), Sheet + "Net Weight 必填");
                        //akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Volume_L, (mt.LOG_Volume + "").Trim(), Sheet + "Volume 必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Unit_Of_Measure_X_L, (mt.LOG_Unit_Of_Measure_X_1 + "").Trim(), Sheet + "Unit of measure X 第2行 必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Unit_Of_Measure_Y_L, (mt.LOG_Unit_Of_Measure_Y_1 + "").Trim(), Sheet + "Unit of measure Y 第2行 必填");

                        if (Action != "S")
                        {
                            regs.Add(new Regular(RegularExp.NotEmpty, mt.LOG_LoadingGrp, Sheet + "LoadingGrp 为必填"));
                        }


                        return Validation(regs);
                    }
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Coefficient_Of_Logistic_L, mt.LOG_Coefficient_Of_Logistic, Sheet + "Coefficient of logistic 必填");
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_LoadingGrp_L, mt.LOG_LoadingGrp, Sheet + "LoadingGrp 必填");
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Storage_Location_L, mt.LOG_Storage_Location, Sheet + "Store Location 必填");
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Plant_L, mt.LOG_Plant, Sheet + "Plant 必填");
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Gross_Weight_L, (mt.LOG_Gross_Weight + "").Trim(), Sheet + "Gross Weight 必填");
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Net_Weight_L, (mt.LOG_Net_Weight + "").Trim(), Sheet + "Net Weight 必填");
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Volume_L, (mt.LOG_Volume + "").Trim(), Sheet + "Volume 必填");
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Unit_Of_Measure_X_L, (mt.LOG_Unit_Of_Measure_X_1 + "").Trim(), Sheet + "Unit of measure X 第2行 必填");

                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Unit_Of_Measure_AUN_L, mt.LOG_Unit_Of_Measure_AUN, Sheet + "Unit of measure AUN 必填");
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Unit_Of_Measure_Y_L, (mt.LOG_Unit_Of_Measure_Y_1 + "").Trim(), Sheet + "Unit of measure Y 第2行 必填");
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Unit_Of_Measure_Bun_L, mt.LOG_Unit_Of_Measure_Bun, Sheet + "Unit of measure BUN 必填");
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, LOG_Quantity_per_box_L, mt.LOG_Quantity_per_box, Sheet + "Quantity per Box 必填");


                    break;
            }

            return Validation(regs);
        }
        #endregion

        #region SelectedIndexChanged事件
        protected void LOG_Stock_placement_SelectedIndexChanged(object sender, EventArgs e)
        {
            SetEnable(true, LOG_Storage_Section_Ind);
            SetEnable(true, LOG_Bulk_storage);
            LOG_Bulk_storage.Text = "";
            if (LOG_Stock_placement.SelectedValue == "I01")
            {
                //SetEnable(true, LOG_Storage_Section_Ind);
                //SetForeColor(Color.Blue, LOG_Storage_Section_Ind_L);
                //LOG_Storage_Section_Ind.Items.RemoveAt(LOG_Storage_Section_Ind.Items.Count-1);
            }
            else if (LOG_Stock_placement.SelectedValue == "I02")
            {
                LOG_Bulk_storage.Text = "02";
                SetEnable(false, LOG_Bulk_storage);
                //SetForeColor(Color.Blue, LOG_Storage_Section_Ind_L);
            }
            //else
            //{
            //    SetForeColor(Color.Black, LOG_Storage_Section_Ind_L);
            //}
        }
        protected void LOG_Quantity_per_box_TextChanged(object sender, EventArgs e)
        {
            LOG_Unit_Of_Measure_Y.Text = LOG_Quantity_per_box.Text;
        }

        protected void LOG_Net_Weight_TextChanged(object sender, EventArgs e)
        {
            // LOG_Unit_Of_Measure_X_1.Text = LOG_Net_Weight.Text;

        }

        protected void LOG_Volume_TextChanged(object sender, EventArgs e)
        {
            //LOG_Unit_Of_Measure_X_2.Text = LOG_Volume.Text;
        }
        #endregion

        #region Storage Type
        protected void LOG_Storage_Type_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (LOG_Storage_Type.SelectedValue == "P01")
            {
                SetVisible(true, LOG_Storage_Bin, LOG_Storage_Bin_L, LOG_Maximum_bin_quantity, LOG_Maximum_bin_quantity_L, LOG_Control_quantity
                               , LOG_Control_quantity_L, LOG_Minimum_bin_quantity, LOG_Minimum_bin_quantity_L, LOG_Replenishment_qty, LOG_Replenishment_qty_L);
            }
            else
            {
                SetVisible(false, LOG_Storage_Bin, LOG_Storage_Bin_L, LOG_Maximum_bin_quantity, LOG_Maximum_bin_quantity_L, LOG_Control_quantity
                                , LOG_Control_quantity_L, LOG_Minimum_bin_quantity, LOG_Minimum_bin_quantity_L, LOG_Replenishment_qty, LOG_Replenishment_qty_L);
            }

        }
        #endregion

        #region Storage Bin
        protected void LOG_Storage_Bin_TextChanged(object sender, EventArgs e)
        {
            string s = LOG_Storage_Bin.Text + LOG_Maximum_bin_quantity.Text + LOG_Control_quantity.Text + LOG_Minimum_bin_quantity.Text + LOG_Replenishment_qty.Text;
            if (LOG_Storage_Type.SelectedValue == "P01")
            {
                if (string.IsNullOrEmpty(s))
                {
                    SetForeColor(Color.Black, LOG_Maximum_bin_quantity_L, LOG_Control_quantity_L, LOG_Minimum_bin_quantity_L, LOG_Replenishment_qty_L, LOG_Storage_Bin_L);
                }

                else
                {
                    SetForeColor(Color.Blue, LOG_Maximum_bin_quantity_L, LOG_Control_quantity_L, LOG_Minimum_bin_quantity_L, LOG_Replenishment_qty_L, LOG_Storage_Bin_L);
                }
            }
            else
            {
                SetForeColor(Color.Black, LOG_Maximum_bin_quantity_L, LOG_Control_quantity_L, LOG_Minimum_bin_quantity_L, LOG_Replenishment_qty_L, LOG_Storage_Bin_L);
            }
        }
        #endregion

        #region Maximum bin quantity
        protected void LOG_Maximum_bin_quantity_TextChanged(object sender, EventArgs e)
        {
            string s = LOG_Storage_Bin.Text + LOG_Maximum_bin_quantity.Text + LOG_Control_quantity.Text + LOG_Minimum_bin_quantity.Text + LOG_Replenishment_qty.Text;
            if (LOG_Storage_Type.SelectedValue == "P01")
            {
                if (string.IsNullOrEmpty(s))
                {
                    SetForeColor(Color.Black, LOG_Maximum_bin_quantity_L, LOG_Control_quantity_L, LOG_Minimum_bin_quantity_L, LOG_Replenishment_qty_L, LOG_Storage_Bin_L);
                }

                else
                {
                    SetForeColor(Color.Blue, LOG_Maximum_bin_quantity_L, LOG_Control_quantity_L, LOG_Minimum_bin_quantity_L, LOG_Replenishment_qty_L, LOG_Storage_Bin_L);
                }
            }
            else
            {
                SetForeColor(Color.Black, LOG_Maximum_bin_quantity_L, LOG_Control_quantity_L, LOG_Minimum_bin_quantity_L, LOG_Replenishment_qty_L, LOG_Storage_Bin_L);
            }
        }
        #endregion

        #region Control quantity
        protected void LOG_Control_quantity_TextChanged(object sender, EventArgs e)
        {
            string s = LOG_Storage_Bin.Text + LOG_Maximum_bin_quantity.Text + LOG_Control_quantity.Text + LOG_Minimum_bin_quantity.Text + LOG_Replenishment_qty.Text;
            if (LOG_Storage_Type.SelectedValue == "P01")
            {
                if (string.IsNullOrEmpty(s))
                {
                    SetForeColor(Color.Black, LOG_Maximum_bin_quantity_L, LOG_Control_quantity_L, LOG_Minimum_bin_quantity_L, LOG_Replenishment_qty_L, LOG_Storage_Bin_L);
                }

                else
                {
                    SetForeColor(Color.Blue, LOG_Maximum_bin_quantity_L, LOG_Control_quantity_L, LOG_Minimum_bin_quantity_L, LOG_Replenishment_qty_L, LOG_Storage_Bin_L);
                }
            }
            else
            {
                SetForeColor(Color.Black, LOG_Maximum_bin_quantity_L, LOG_Control_quantity_L, LOG_Minimum_bin_quantity_L, LOG_Replenishment_qty_L, LOG_Storage_Bin_L);
            }
        }
        #endregion

        #region Minimum bin quantity
        protected void LOG_Minimum_bin_quantity_TextChanged(object sender, EventArgs e)
        {
            string s = LOG_Storage_Bin.Text + LOG_Maximum_bin_quantity.Text + LOG_Control_quantity.Text + LOG_Minimum_bin_quantity.Text + LOG_Replenishment_qty.Text;
            if (LOG_Storage_Type.SelectedValue == "P01")
            {
                if (string.IsNullOrEmpty(s))
                {
                    SetForeColor(Color.Black, LOG_Maximum_bin_quantity_L, LOG_Control_quantity_L, LOG_Minimum_bin_quantity_L, LOG_Replenishment_qty_L, LOG_Storage_Bin_L);
                }

                else
                {
                    SetForeColor(Color.Blue, LOG_Maximum_bin_quantity_L, LOG_Control_quantity_L, LOG_Minimum_bin_quantity_L, LOG_Replenishment_qty_L, LOG_Storage_Bin_L);
                }
            }
            else
            {
                SetForeColor(Color.Black, LOG_Maximum_bin_quantity_L, LOG_Control_quantity_L, LOG_Minimum_bin_quantity_L, LOG_Replenishment_qty_L, LOG_Storage_Bin_L);
            }
        }
        #endregion

        #region Replenishment qty
        protected void LOG_Replenishment_qty_TextChanged(object sender, EventArgs e)
        {
            string s = LOG_Storage_Bin.Text + LOG_Maximum_bin_quantity.Text + LOG_Control_quantity.Text + LOG_Minimum_bin_quantity.Text + LOG_Replenishment_qty.Text;
            if (LOG_Storage_Type.SelectedValue == "P01")
            {
                if (string.IsNullOrEmpty(s))
                {
                    SetForeColor(Color.Black, LOG_Maximum_bin_quantity_L, LOG_Control_quantity_L, LOG_Minimum_bin_quantity_L, LOG_Replenishment_qty_L, LOG_Storage_Bin_L);
                }

                else
                {
                    SetForeColor(Color.Blue, LOG_Maximum_bin_quantity_L, LOG_Control_quantity_L, LOG_Minimum_bin_quantity_L, LOG_Replenishment_qty_L, LOG_Storage_Bin_L);
                }
            }
            else
            {
                SetForeColor(Color.Black, LOG_Maximum_bin_quantity_L, LOG_Control_quantity_L, LOG_Minimum_bin_quantity_L, LOG_Replenishment_qty_L, LOG_Storage_Bin_L);
            }
        }
        #endregion


    }
}
